Can't fix, please help. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Can't fix, please help. (
/showthread.php?tid=495193)
Can't fix, please help. -
Ercha - 16.02.2014
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;
}