Posts: 357
Threads: 6
Joined: Feb 2018
Quote:
Originally Posted by v1k1nG
Try using
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;
}
better than params[0]
|
Should be like this.
Код:
if(sscanf(params,"d",targetid)) return SendClientMessage(playerid, -1,"CMD: /afk [ID]");