Ik ben een anti-afk script aan het maken, ben nu al 3 uur bezig om een paar errors weg te halen. Hier mijn script:
/*
################################################################################
############ ##############
############ This is a filterscript against being afk for hours ##############
############ If a player is afk for 1 hour he will get kicked ##############
############ Scripted by: Clank ##############
############ Please report bugs at me in the sa-mp.com forum ##############
############ (Nickname: Clank) ##############
############ ##############
################################################################################
*/
#include <a_samp>
#include <a_players>
#define FILTERSCRIPT
#define COLOR_YELLOW 0xFFFF00AA // Yellow
/*
################################################################################
############ All the defines & includes we need ##############
################################################################################
*/
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print("Anti-AFK by Clank");
print("--------------------------------------\n");
return 1;
}
forward IsPlayerAfk (playerid);
//---------------The forward is above and the funtion beneath-------------------
if (IsPlayerAfk (playerid) == 1) //i think here is the problem
{
Kick(playerid);
SendClientMessageToAll(COLOR_YELLOW, NEVER be too long afk);
}
public OnFilterScriptExit()
{
return 1;
}
//------------------The new function is beneath this line-----------------------
IsPlayerAfk (playerid)
{
new
GetPlayerPos(playerid, &pos1x, &pos1y, &pos1z);
SetTimer(time afk, 3600000, true);
GetPlayerPos(playerid, &pos2x, &pos2y, &pos2z);
if (&pos1x = &pos2x, &pos1y = &pos2y, &pos1z = &pos2z);
KillTimer(time afk);
}
#endif
Hoi,
Ik ben een anti-afk script aan het maken, ben nu al 3 uur bezig om een paar errors weg te halen. Hier mijn script:
/* ################################################################################ ############ ############## ############ This is a filterscript against being afk for hours ############## ############ If a player is afk for 1 hour he will get kicked ############## ############ Scripted by: Clank ############## ############ Please report bugs at me in the sa-mp.com forum ############## ############ (Nickname: Clank) ############## ############ ############## ################################################################################ */ #include <a_samp> #include <a_players> #define FILTERSCRIPT #define COLOR_YELLOW 0xFFFF00AA // Yellow /* ################################################################################ ############ All the defines & includes we need ############## ################################################################################ */ #if defined FILTERSCRIPT public OnFilterScriptInit() { print("\n--------------------------------------"); print("Anti-AFK by Clank"); print("--------------------------------------\n"); return 1; } forward IsPlayerAfk (playerid); //---------------The forward is above and the funtion beneath------------------- if (IsPlayerAfk (playerid) == 1) //i think here is the problem { Kick(playerid); SendClientMessageToAll(COLOR_YELLOW, NEVER be too long afk); } public OnFilterScriptExit() { return 1; } //------------------The new function is beneath this line----------------------- IsPlayerAfk (playerid) { new GetPlayerPos(playerid, &pos1x, &pos1y, &pos1z); SetTimer(time afk, 3600000, true); GetPlayerPos(playerid, &pos2x, &pos2y, &pos2z); if (&pos1x = &pos2x, &pos1y = &pos2y, &pos1z = &pos2z); KillTimer(time afk); } #endiferrors: