Pomoc

Započeo Mikix
1. Mar. 2020. Zaključano
2,352
pregleda
23
postova
Mikix
2
Wheel Man
1. Mar. 2020.
Problem(error/warning): Kako da napravim da posle registera odnosno kada ukuca koji oce pasword da mu bude da mu posle toga izbaci
da izabere pol,kada sam ja namjestio izbaci da izbabere pol ali nakon toga ne pita za sifru vec pise ono dole spawn
Dio skripte: Ako bude bilo potrebno poslacu....
Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log): //
Slika/video ingame problema(obavezno ako je ingame problem)
Ako neko zna neka pomogne... 🤐 🤐 🤐
Rudimental
5
OG Legend
1. Mar. 2020.
Ocigledno nisi definisao sta da se desi kada odabere pol. Stavi da mu otvori dialog za password ako vec tako zelis..
Mikix
2
Wheel Man
1. Mar. 2020.
Evo kako sam napravio ovo gdje sad da stavim da posle kad upise lozinku da mu izadje za pol
public OnPlayerConnect(playerid)
{
    if(fexist(UserPath(playerid)))
    {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Type your password below to login.","Login","Quit");
    }
    else
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"Type your password below to register a new account.","Register","Quit");
    }
    return 1;
}

i EVO ONPLAYERDIALOG
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch( dialogid )
    {
        case DIALOG_REGISTER:
        {
            if (!response) return Kick(playerid);
            if(response)
            {
                if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Registering...",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
                new INI:File = INI_Open(UserPath(playerid));
                INI_SetTag(File,"data");
                INI_WriteInt(File,"Password",udb_hash(inputtext));
                INI_WriteInt(File,"Cash",0);
                INI_WriteInt(File,"Admin",0);
                INI_WriteInt(File,"Kills",0);
                INI_WriteInt(File,"Deaths",0);
                INI_Close(File);

                SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
                SpawnPlayer(playerid);
                ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"Great! Your Y_INI system works perfectly. Relog to save your stats!","Ok","");
            }
        }

        case DIALOG_LOGIN:
        {
            if ( !response ) return Kick ( playerid );
            if( response )
            {
                if(udb_hash(inputtext) == PlayerInfo)
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    GivePlayerMoney(playerid, PlayerInfo);
                    ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"You have successfully logged in!","Ok","");
                }
                else
                {
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"You have entered an incorrect password.\n"COL_WHITE"Type your password below to login.","Login","Quit");
                }
                return 1;
            }
        }
    }
    return 1;
}
Skrilew
6
Godfather
2. Mar. 2020.
case DIALOG_REGISTER:
        {
            if (!response) return Kick(playerid);
            if(response)
            {
                if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Registering...",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
                new INI:File = INI_Open(UserPath(playerid));
                INI_SetTag(File,"data");
                INI_WriteInt(File,"Password",udb_hash(inputtext));
                INI_WriteInt(File,"Cash",0);
                INI_WriteInt(File,"Admin",0);
                INI_WriteInt(File,"Kills",0);
                INI_WriteInt(File,"Deaths",0);
                INI_WriteInt(File,"Pol",0);
                INI_Close(File);

                ShowPlayerDialog(playerid, DIALOG_POL, DIALOG_STYLE_MSGBOX, "Registracija", "Odaberi pol", "Musko", "Zensko");
            }
        }


Takodje, definises DIALOG_POL isto kao sto si DIALOG_REGISTER i DIALOG_LOGIN, zatim u cuvanju igraca dodajes pPol, nakon toga mozes da radis sta ti je volja sa tim, da li ces mu setati skin na osnovu toga, na tebi je..
Evo ti i za DIALOG_POL kako bi otprilike izgledalo
case DIALOG_POL:
        {
            if(!response)
            {
                PlayerInfo = 2; //Zensko
                SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
                SpawnPlayer(playerid);
                return 1;
            }
            if(response)
            {
                PlayerInfo = 1; //Musko
                SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
                SpawnPlayer(playerid);
                return 1;
            }
        }


Nadam se da sam pomogao, nauci prvo osnove :/
Mikix
2
Wheel Man
2. Mar. 2020.
E hvala ti mozes mi sada reci u texdrawu za stats kako da stavim ako je pPol= 1 Da mu stavi da je musko a kako ako je pPol=2 stavi zensko
Textdraw10 = CreatePlayerTextDraw(playerid,577.500000, 266.933288, "Pol");
PlayerTextDrawLetterSize(playerid,Textdraw10, 0.413500, 1.201777);
PlayerTextDrawAlignment(playerid,Textdraw10, 1);
PlayerTextDrawColor(playerid,Textdraw10, -1);
PlayerTextDrawSetShadow(playerid,Textdraw10, 0);
PlayerTextDrawSetOutline(playerid,Textdraw10, 1);
PlayerTextDrawBackgroundColor(playerid,Textdraw10, 51);
PlayerTextDrawFont(playerid,Textdraw10, 1);
PlayerTextDrawSetProportional(playerid,Textdraw10, 1);
Skrilew
6
Godfather
2. Mar. 2020.
Hmmm, putem PlayerTextDrawSetString??

Kada kuca /stats, prikaze textdraw, uradis ovako nesto:
new poligraca;
if(PlayerInfo = 1) { poligraca = "Musko"; }
if(PlayerInfo = 2) { poligraca = "Zensko"; }
new string;
format(string, 20, "Pol:%s", poligraca);
PlayerTextDrawSetString(playerid, Textdraw10, string);


Naravno, ovo ti je primer jedan, ti prilagodi kako ti odgovara..
SyS
2
Wheel Man
2. Mar. 2020.
V01D wrote on March 2, 2020, 9:03 pm:
Hmmm, putem PlayerTextDrawSetString??

Kada kuca /stats, prikaze textdraw, uradis ovako nesto:
new poligraca;
if(PlayerInfo = 1) { poligraca = "Musko"; }
if(PlayerInfo = 2) { poligraca = "Zensko"; }
new string;
format(string, 20, "Pol:%s", poligraca);
PlayerTextDrawSetString(playerid, Textdraw10, string);


Naravno, ovo ti je primer jedan, ti prilagodi kako ti odgovara..


PlayerTextDrawSetString(playerid, Textdraw10, (PlayerInfo == 1) ? ("Musko") : ("Zensko")); 😄
Skrilew
6
Godfather
2. Mar. 2020.
SyS wrote on March 2, 2020, 9:04 pm:
PlayerTextDrawSetString(playerid, Textdraw10, (PlayerInfo == 1) ? ("Musko") : ("Zensko")); 😄


Ja sam jako kompleksan momak xDD 😄
Mikix
2
Wheel Man
2. Mar. 2020.
Imam ova dva error
1229) : warning 211: possibly unintended assignment
(1230) : warning 211: possibly unintended assignment


Kod ovoga
if(PlayerInfo = 1) { poligraca = "Musko"; }
if(PlayerInfo = 2) { poligraca = "Zensko"; }
Skrilew
6
Godfather
2. Mar. 2020.
if(PlayerInfo == 1) { poligraca = "Musko"; }
if(PlayerInfo == 2) { poligraca = "Zensko"; }


Moja greska :/
SyS
2
Wheel Man
2. Mar. 2020.
Mikix wrote on March 2, 2020, 9:27 pm:
Imam ova dva error
1229) : warning 211: possibly unintended assignment
(1230) : warning 211: possibly unintended assignment


Kod ovoga
if(PlayerInfo = 1) { poligraca = "Musko"; }
if(PlayerInfo = 2) { poligraca = "Zensko"; }


Zasto prosto ne prekoprias ono sto sam ja poslao?
Aj sto je urednije nego sto je i brze i ne kreiras string niti ista 🙂
Mikix
2
Wheel Man
2. Mar. 2020.
Ne izbacije mi ni da je musko ni da je zesnko mozes mi u fulu napravit citav kod
Textdraw10 = CreatePlayerTextDraw(playerid,577.500000, 266.933288, "Pol");
PlayerTextDrawLetterSize(playerid,Textdraw10, 0.413500, 1.201777);
PlayerTextDrawAlignment(playerid,Textdraw10, 1);
PlayerTextDrawColor(playerid,Textdraw10, -1);
PlayerTextDrawSetShadow(playerid,Textdraw10, 0);
PlayerTextDrawSetOutline(playerid,Textdraw10, 1);
PlayerTextDrawBackgroundColor(playerid,Textdraw10, 51);
PlayerTextDrawFont(playerid,Textdraw10, 1);
PlayerTextDrawSetProportional(playerid,Textdraw10, 1);

pa dodaj gdje treba to
Skrilew
6
Godfather
2. Mar. 2020.
SyS wrote on March 2, 2020, 9:40 pm:
Zasto prosto ne prekoprias ono sto sam ja poslao?
Aj sto je urednije nego sto je i brze i ne kreiras string niti ista 🙂


Zasto? Teze mu je da skapira. 90% ljudi ovde ne zna sta tvoja linija znaci, znas zasto? Zato sto to niko nije ucio, Balkanci to ne primenjuju.. A ovi danas nece da uce od 0, vec hoce odmah da edituju i tako da "uce"..

Mikix wrote on March 2, 2020, 9:45 pm:
Ne izbacije mi ni da je musko ni da je zesnko mozes mi u fulu napravit citav kod
Textdraw10 = CreatePlayerTextDraw(playerid,577.500000, 266.933288, "Pol");
PlayerTextDrawLetterSize(playerid,Textdraw10, 0.413500, 1.201777);
PlayerTextDrawAlignment(playerid,Textdraw10, 1);
PlayerTextDrawColor(playerid,Textdraw10, -1);
PlayerTextDrawSetShadow(playerid,Textdraw10, 0);
PlayerTextDrawSetOutline(playerid,Textdraw10, 1);
PlayerTextDrawBackgroundColor(playerid,Textdraw10, 51);
PlayerTextDrawFont(playerid,Textdraw10, 1);
PlayerTextDrawSetProportional(playerid,Textdraw10, 1);

pa dodaj gdje treba to


Posalji celu komandu gde prikazujes tdove
Mikix
2
Wheel Man
2. Mar. 2020.
public OnPlayerConnect( playerid )
{
new tdstring;
format(tdstring, sizeof(tdstring), "Ime i Prezime:~n~ ~y~ ~h~%s",PlayerName(playerid));
Textdraw6 = CreatePlayerTextDraw(playerid,497.000000, 266.311096,tdstring);
PlayerTextDrawLetterSize(playerid,Textdraw6, 0.245000, 1.257777);
PlayerTextDrawAlignment(playerid,Textdraw6, 1);
PlayerTextDrawColor(playerid,Textdraw6, -1);
PlayerTextDrawSetShadow(playerid,Textdraw6, 0);
PlayerTextDrawSetOutline(playerid,Textdraw6, 1);
PlayerTextDrawBackgroundColor(playerid,Textdraw6, 51);
PlayerTextDrawFont(playerid,Textdraw6, 1);
PlayerTextDrawSetProportional(playerid,Textdraw6, 1);

PlayerTextDrawSetString(playerid, Textdraw10, (PlayerInfo == 1) ? ("~n~ ~w~Musko") : ("~n~ ~w~Zensko"));//OVO SAM SAD DODAO KAKO JE OVAJ GORE NAPISAO
Textdraw10 = CreatePlayerTextDraw(playerid,577.500000, 266.933288,"Pol");
PlayerTextDrawLetterSize(playerid,Textdraw10, 0.413500, 1.201777);
PlayerTextDrawAlignment(playerid,Textdraw10, 1);
PlayerTextDrawColor(playerid,Textdraw10, -1);
PlayerTextDrawSetShadow(playerid,Textdraw10, 0);
PlayerTextDrawSetOutline(playerid,Textdraw10, 1);
PlayerTextDrawBackgroundColor(playerid,Textdraw10, 51);
PlayerTextDrawFont(playerid,Textdraw10, 1);
PlayerTextDrawSetProportional(playerid,Textdraw10, 1);
return 1;
}
CMD:stats(playerid, params[], help)
{
    PlayerTextDrawShow(playerid, Textdraw0);
    PlayerTextDrawShow(playerid, Textdraw1);
    PlayerTextDrawShow(playerid, Textdraw2);
    PlayerTextDrawShow(playerid, Textdraw3);
    PlayerTextDrawShow(playerid, Textdraw4);
    PlayerTextDrawShow(playerid, Textdraw5);
    PlayerTextDrawShow(playerid, Textdraw6);
    PlayerTextDrawShow(playerid, Textdraw7);
    PlayerTextDrawShow(playerid, Textdraw8);
    PlayerTextDrawShow(playerid, Textdraw9);
    PlayerTextDrawShow(playerid, Textdraw10);
    PlayerTextDrawShow(playerid, Textdraw11);
    PlayerTextDrawShow(playerid, Textdraw12);
    PlayerTextDrawShow(playerid, Textdraw13);
    PlayerTextDrawShow(playerid, Textdraw14);
    PlayerTextDrawShow(playerid, Textdraw15);
    PlayerTextDrawShow(playerid, Textdraw16);
    PlayerTextDrawShow(playerid, Textdraw17);
    PlayerTextDrawShow(playerid, Textdraw18);
    PlayerTextDrawShow(playerid, Textdraw19);
    PlayerTextDrawShow(playerid, Textdraw20);
                    //ovdej ima vise texdrawova al nisam stavljao gore sve da bez veze punim mjesta,...
    return 1;
}
ᗪ乇Ҝ丂卂
5
Underboss
2. Mar. 2020.
Mikix wrote on March 2, 2020, 10:04 pm:
public OnPlayerConnect( playerid )
{
new tdstring;
format(tdstring, sizeof(tdstring), "Ime i Prezime:~n~ ~y~ ~h~%s",PlayerName(playerid));
Textdraw6 = CreatePlayerTextDraw(playerid,497.000000, 266.311096,tdstring);
PlayerTextDrawLetterSize(playerid,Textdraw6, 0.245000, 1.257777);
PlayerTextDrawAlignment(playerid,Textdraw6, 1);
PlayerTextDrawColor(playerid,Textdraw6, -1);
PlayerTextDrawSetShadow(playerid,Textdraw6, 0);
PlayerTextDrawSetOutline(playerid,Textdraw6, 1);
PlayerTextDrawBackgroundColor(playerid,Textdraw6, 51);
PlayerTextDrawFont(playerid,Textdraw6, 1);
PlayerTextDrawSetProportional(playerid,Textdraw6, 1);

PlayerTextDrawSetString(playerid, Textdraw10, (PlayerInfo == 1) ? ("~n~ ~w~Musko") : ("~n~ ~w~Zensko"));//OVO SAM SAD DODAO KAKO JE OVAJ GORE NAPISAO
Textdraw10 = CreatePlayerTextDraw(playerid,577.500000, 266.933288,"Pol");
PlayerTextDrawLetterSize(playerid,Textdraw10, 0.413500, 1.201777);
PlayerTextDrawAlignment(playerid,Textdraw10, 1);
PlayerTextDrawColor(playerid,Textdraw10, -1);
PlayerTextDrawSetShadow(playerid,Textdraw10, 0);
PlayerTextDrawSetOutline(playerid,Textdraw10, 1);
PlayerTextDrawBackgroundColor(playerid,Textdraw10, 51);
PlayerTextDrawFont(playerid,Textdraw10, 1);
PlayerTextDrawSetProportional(playerid,Textdraw10, 1);
return 1;
}
CMD:stats(playerid, params[], help)
{
    PlayerTextDrawShow(playerid, Textdraw0);
    PlayerTextDrawShow(playerid, Textdraw1);
    PlayerTextDrawShow(playerid, Textdraw2);
    PlayerTextDrawShow(playerid, Textdraw3);
    PlayerTextDrawShow(playerid, Textdraw4);
    PlayerTextDrawShow(playerid, Textdraw5);
    PlayerTextDrawShow(playerid, Textdraw6);
    PlayerTextDrawShow(playerid, Textdraw7);
    PlayerTextDrawShow(playerid, Textdraw8);
    PlayerTextDrawShow(playerid, Textdraw9);
    PlayerTextDrawShow(playerid, Textdraw10);
    PlayerTextDrawShow(playerid, Textdraw11);
    PlayerTextDrawShow(playerid, Textdraw12);
    PlayerTextDrawShow(playerid, Textdraw13);
    PlayerTextDrawShow(playerid, Textdraw14);
    PlayerTextDrawShow(playerid, Textdraw15);
    PlayerTextDrawShow(playerid, Textdraw16);
    PlayerTextDrawShow(playerid, Textdraw17);
    PlayerTextDrawShow(playerid, Textdraw18);
    PlayerTextDrawShow(playerid, Textdraw19);
    PlayerTextDrawShow(playerid, Textdraw20);
                    //ovdej ima vise texdrawova al nisam stavljao gore sve da bez veze punim mjesta,...
    return 1;
}

Textdraw10 = CreatePlayerTextDraw(playerid,577.500000, 266.933288,(PlayerInfo == 1) ? ("~n~ ~w~Musko") : ("~n~ ~w~Zensko"));

Morate biti prijavljeni da biste odgovorili na ovu temu.

Prijava

© 2026 SmartShark. All rights reserved.

Powered by Momentum|v2026.3.001 Alpha