Nevermind about what I wrote above, its fixed now.
I have a minor problem now that goes like this: I set it so maximum string length is 20 but when I do more than 20, it should return a "String is too long" message, and it does if the string is between 21 to 23 characters. When the string is above 23, it tells me "ERROR: Command does not exist!". Please help me if you know how to fix it!
pawn Код:
#define PASSWORD_MAXIMUM_CHARS 20
COMMAND:encrypt(playerid, params[])
{
if(isPlayerAdmin(playerid) >= 2)
{
new pass[PASSWORD_MAXIMUM_CHARS];
if(!sscanf(params, "s", pass))
{
if(strlen(pass) > PASSWORD_MAXIMUM_CHARS)
return SendClientMessageEx(playerid, 0xFF0000FF, "ERROR: String entered is too long!");
else
EncryptPass(playerid, pass);
}
else SendClientMessageEx(playerid, -1, "USAGE: /encrypt <string/pass>");
}
else SendClientMessageEx(playerid, 0xFFFF0000, "ERROR: Insufficient permission!");
return 1;
}