CMD:afktime(playerid,params[])
{
new targetid,string[128];
if(sscanf(params, "ui",targetid)) return SendClientMessage(playerid,-1,""COL_RED"Cmds: /afktime [playerid]");
format(string,sizeof(string),""COL_RED"%s is afk for %s seconds.",PlayerName(targetid), Afktime);
SendClientMessage(playerid,-1,string);
}
else {
SendClientMessage(playerid,-1,""COL_RED"ERROR: This player is not afk!");
}
return 1;
}
new bool:InAFK[MAX_PLAYERS]; // my variable for example CMD:afktime(playerid,params[]) { new targetid,string[128]; if(sscanf(params, "u",targetid)) return SendClientMessage(playerid,-1,""COL_RED"Cmds: /afktime [playerid]"); if(InAFK[targetid] == false) return SendClientMessage(playerid,-1,""COL_RED"ERROR: This player is not afk!"); format(string,sizeof(string),""COL_RED"%s is afk for %s seconds.",PlayerName(targetid), Afktime); SendClientMessage(playerid,-1,string); } return 1; }
Yeah, you need to use a variable for the player to set whether he/she is in AFK or not.
|