09.10.2015, 21:15
Another problem popped up, this is the code now:
But even if I only type in 4 digits. it still gives the "SERVER:" message, and doesn't set the pin.
PHP код:
CMD:changeadminpin(playerid, params[])
{
new pass[4], string[128];
if(PlayerInfo[playerid][pAdmin] >= 1)
{
if(sscanf(params, "s[4]", pass)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /changeadminpin [Pin code]");
if(strlen(pass) != 4) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: The pincode must be 4 digits.");
sscanf(pass, "i", PlayerInfo[playerid][pSecKey]);
format(string, sizeof(string), "{FFFFFF}SERVER: You've successfully changed your pin code to %s.", pass);
SendClientMessage(playerid, COLOR_WHITE, string);
}
else return SendClientMessage(playerid, COLOR_GRAD2, NOTADMIN);
return 1;
}