07.02.2014, 18:56
Hello, can anyone make me a AFK System where admins can tipe /afk and they can see what players is on afk and how long.
Sorry for my bad English
Sorry for my bad English
// On top of your script
new playerAFKCount[MAX_PLAYERS]; // ->Var
// On OnPlayerUpdate(playerid);
public OnPlayerUpdate(playerid)
{
playerAFKCount[playerid] = gettime(); //Unix-timestamp.
return 1;
}
// In your /afk command
new afkSeconds = (((playerAFKCount[id] - gettime()) / 60) / 1000); // This should return you the seconds count of how much a player is afk.
C:\Users\Tadas\Desktop\Serveris\gamemodes\naujas.p wn(7) : error 017: undefined symbol "MAX_PLAYERS" C:\Users\Tadas\Desktop\Serveris\gamemodes\naujas.p wn(7) : error 009: invalid array size (negative, zero or out of bounds) C:\Users\Tadas\Desktop\Serveris\gamemodes\naujas.p wn(737) : error 003: declaration of a local variable must appear in a compound block C:\Users\Tadas\Desktop\Serveris\gamemodes\naujas.p wn(737) : error 017: undefined symbol "afkSeconds" C:\Users\Tadas\Desktop\Serveris\gamemodes\naujas.p wn(737) : error 017: undefined symbol "id" C:\Users\Tadas\Desktop\Serveris\gamemodes\naujas.p wn(737) : fatal error 107: too many error messages on one line |