Checking if inputtext is 4 digits.
#6

Another problem popped up, this is the code now:
PHP код:
CMD:changeadminpin(playeridparams[])
{
    new 
pass[4], string[128];
    if(
PlayerInfo[playerid][pAdmin] >= 1)
    {
        if(
sscanf(params"s[4]"pass)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /changeadminpin [Pin code]");
        if(
strlen(pass) != 4) return SendClientMessage(playeridCOLOR_WHITE"SERVER: The pincode must be 4 digits.");
        
sscanf(pass"i"PlayerInfo[playerid][pSecKey]);
         
format(stringsizeof(string), "{FFFFFF}SERVER: You've successfully changed your pin code to %s."pass);
         
SendClientMessage(playeridCOLOR_WHITEstring);
    }
    else return 
SendClientMessage(playeridCOLOR_GRAD2NOTADMIN);
    return 
1;

But even if I only type in 4 digits. it still gives the "SERVER:" message, and doesn't set the pin.
Reply


Messages In This Thread
Checking if inputtext is 4 digits. - by faff - 09.10.2015, 20:54
Re: Checking if inputtext is 4 digits. - by ThePhenix - 09.10.2015, 20:56
Re: Checking if inputtext is 4 digits. - by Crayder - 09.10.2015, 21:00
Re: Checking if inputtext is 4 digits. - by faff - 09.10.2015, 21:01
Re: Checking if inputtext is 4 digits. - by faff - 09.10.2015, 21:06
Re: Checking if inputtext is 4 digits. - by faff - 09.10.2015, 21:15
Re: Checking if inputtext is 4 digits. - by Ahmad45123 - 09.10.2015, 21:19
Re: Checking if inputtext is 4 digits. - by faff - 09.10.2015, 21:40
Re: Checking if inputtext is 4 digits. - by Crayder - 09.10.2015, 21:53
Re: Checking if inputtext is 4 digits. - by Ahmad45123 - 09.10.2015, 22:08

Forum Jump:


Users browsing this thread: 4 Guest(s)