04.03.2011, 11:17
Well i was testing my new script in development with a few players, and i found this problem..
Yeah, so this isn't happening with just this command, it happens with all of my commands
that requires a Player ID input.
They simply don't work for ID 3 and above, they work for ID 0, ID 1 and ID 2.
With that i mean "giveid", If i type /setcash 3 100000 it returns 0 and I get "This player is not connected"
Using ZCMD and sscanf2.
Yeah, so this isn't happening with just this command, it happens with all of my commands
that requires a Player ID input.
They simply don't work for ID 3 and above, they work for ID 0, ID 1 and ID 2.
With that i mean "giveid", If i type /setcash 3 100000 it returns 0 and I get "This player is not connected"
Using ZCMD and sscanf2.
pawn Код:
COMMAND:setcash(playerid,params[])
{
if(pData[playerid][pAdminLevel] >= 3)
{
new cash,giveid,str[96];
if (!sscanf(params, "rn",giveid,cash))
{
if(IsPlayerConnected(giveid))
{
if(cash >= 0 && cash <= 99999999)
{
ResetPlayerCash(giveid);
GivePlayerCash(giveid,cash);
format(str,sizeof(str), "%s's (ID:%d) cash has been set to $%d by %s",PlayerName(giveid),giveid,cash,PlayerName(playerid));
SendMessageToStaff_L3A(str);
format(str,64,"Your cash has been set to $%d by an Administrator.",cash);
SendClientMessage(giveid,COLOR_GREEN,str);
}
else SendClientMessage(playerid,COLOR_RED,"ERROR: Invalid Amount!");
}
else SendClientMessage(playerid, COLOR_RED, "ERROR: This player is not connected!");
}
else SendClientMessage(playerid,-1,"USAGE: /setcash [playerid] [cash]");
}
else SendClientMessage(playerid, COLOR_RED, "ERROR: You are not authorized to use this command.");
return 1;
}