16.02.2014, 11:10
I'm scripting a small anti afk system, that player gets automaticly kicked while been afked longer than 5 mins. But i'm getting the errors when i compile it. Please help..
Код:
error 001: expected token: "-identifier-", but found "(" error 010: invalid function or declaration warning 235: public function lacks forward declaration (symbol "OnPlayerUnPause") error 017: undefined symbol "IsPlayerPaused"
Код:
#include <a_samp> #define OnPlayerPause new AFKtimer; forward AFK(playerid); public OnFilterScriptInit() { print("\n--------------------------------------"); print(" Blank Filterscript by your name here"); print("--------------------------------------\n"); return 1; } public OnPlayerPause(playerid) { AFKtimer = SetTimerEx("AFK", 300000, 0, "i", playerid); return 1; } public OnPlayerUnPause(playerid) { KillTimer(AFKtimer); return 1; } public AFK(playerid) { if(IsPlayerPaused(playerid)) { Kick(playerid); new string[128], playername[24]; GetPlayerName(playerid, playername, 24); format(string, sizeof(string), "%s has been kicked for being AFK (away from keyboard) for more than 5 minutes", playername); SendClientMessageToAll(0xAFAFAFAA, string); } return 1; }