SA-MP Forums Archive
help| not working - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: help| not working (/showthread.php?tid=263299)



help| not working - Armada - 21.06.2011

no error + no work


in game no metter if i putt correct password or uncorrect its give me kick



PHP код:
        if(dialogid == logind)
        {
            if(!
response)
            {
                
ShowPlayerDialog(playeridlogindDIALOG_STYLE_INPUT"Login""You Muyst Enter Password To Login \nPlease Enter Pass""Login""Leave");
                return 
1;
                }
                if(
strlen(inputtext) > 15 || strlen(inputtext) < 5)
            {
                
SCM(playeridCOLOR_RED"ERROR: Lenght Must Be 5-25");
                
ShowPlayerDialog(playeridlogindDIALOG_STYLE_INPUT"Login""You Muyst Enter Password To Login \nPlease Enter Pass""Login""Leave");
                return 
1;
                }
                new 
tmp;
                
tmp dini_Int(file"Password");
            if(
strcmp(inputtext) != tmp)
            {
                
SCM(playeridCOLOR_RED"ERROR: Wrong Password!! bye");
                
Kick(playerid);
                
logged[playerid] = 0;
                }
            else
            {
                
logged[playerid] = 1;
                
SCM(playeridCOLOR_YELLOW" You Seccessfull logged");
                return 
1;
            }
            } 



Re: help| not working - PCheriyan007 - 21.06.2011

Change
pawn Код:
if(strcmp(inputtext) != tmp)
{
    SendClientMessage(playerid, COLOR_RED, "ERROR: Wrong Password!! bye");
    Kick(playerid);
    logged[playerid] = 0;
}
to
pawn Код:
if(strcmp(inputtext) != tmp)
{
    SendClientMessage(playerid, COLOR_RED, "ERROR: Wrong Password!! bye");
    Kick(playerid);
    logged[playerid] = 0;
    return 1; // if you don't add this, it tells the script to keep going into anything else within the function
}



Re: help| not working - Armada - 21.06.2011

PHP код:
            if(strcmp(inputtext) != tmp
PHP код:
 warning 202number of arguments does not match definition 
and no metter if password correct or not its say login succesfull
and why if i do spawn its spawn with the dialog(bifor im done to put password);


Re: help| not working - Armada - 22.06.2011

please help


Re: help| not working - Jeffry - 22.06.2011

pawn Код:
if(strval(inputtext) != tmp)
You get an Integer (dini_INT) so you have to compare the value of the variables (strval).