07.10.2018, 15:29
Try using
better than params[0]
PHP код:
CMD:afk(playerid,params[])
{
new targetid, string[128];
if(sscanf(params,"d",targetid, targetid)) return SendClientMessage(playerid, -1,"CMD: /afk [ID]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid,-1,""COL_RED"Player is not online!");
if(IsPlayerMoving(targetid) == 0)
{
format(string, sizeof(string), "%s is AFK for %d seconds",PlayerName(targetid), AFKTime[targetid]);
SendClientMessage(playerid,-1,string);
}
else
{
SendClientMessage(playerid,-1,"This player is not AFK");
}
return 1;
}