07.10.2018, 12:05
how can i fix this?
In serverlogs it shows wrong parameter.
PHP код:
CMD:afk(playerid,params[])
{
new targetid, string[128];
if(sscanf(params,"d",targetid, params[0])) return SendClientMessage(playerid, -1,"CMD: /afk [ID]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid,-1,""COL_RED"Player is not online!");
if(IsPlayerMoving(params[0]) == 0)
{
format(string, sizeof(string), "%s is AFK for %d seconds",PlayerName(targetid), AFKTime[params[0]]);
SendClientMessage(playerid,-1,string);
}
else
{
SendClientMessage(playerid,-1,"This player is not AFK");
}
return 1;
}