- 0
Problema AFK fs
-
Similar Content
-
- 2 answers
- 614 views
-
Problema turf
By Soryn.,
- 3 answers
- 402 views
-
- 0 replies
- 142 views
-
- 2 replies
- 331 views
-
- 1 reply
- 203 views
-
-
Recently Browsing 0 members
- No registered users viewing this page.
Question
adytza
[pawn]
#include <a_samp>
#define FILTERSCRIPT
#define AFKTime 30 //Cate minute poate fi AFK
#define ShowTime 1 //Activeaza / Dezactiveaza un mesaj trimis jucatorului care a primit kick (0 = nu / 1 = da)
#define Public 1 //Activeaza / Dezactiveaza mesajul care este trimis tuturor (0 = nu / 1 = da)
/*--------------------------NOTHING BELOW THIS POINT NEEDS TO BE CHANGED--------------------------*/
public OnFilterScriptInit()
{
SetTimer("AFKKicker", 60000, 1);
return 1;
}
forward AFKKicker();
new Float:PPos[MAX_PLAYERS][3];
new AFKMins[MAX_PLAYERS];
new show = ShowTime;
new pub = Public;
public OnPlayerConnect(playerid)
{
PPos[playerid][0] = 0;
PPos[playerid][1] = 0;
PPos[playerid][2] = 0;
AFKMins[playerid] = 0;
}
public AFKKicker()
{
for(new i = 0; i <= MAX_PLAYERS; i++)
{
if(PPos[1] == 0)
{
GetPlayerPos(i,PPos[0],PPos[1],PPos[2]);
return 1;
}
new Float:x,Float:y,Float:z;
GetPlayerPos(i,x,y,z);
if(x == PPos[0] && y == PPos[1] && z == PPos[2])
{
AFKMins++;
if(AFKMins >= AFKTime)
{
if(show == 1)
{
new string[128];
SendClientMessage(i, 0xAA3333AA," You was kick by AdmBot, reason: AFK longer than 30 minutes");
SendClientMessage(i,0xAA3333AA,string);
}
else
{
SendClientMessage(i, 0xAA3333AA," You was Away From Keyboard(AFK) for too long");
}
Kick(i);
if(pub == 1)
{
new string[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(i, name, sizeof(name));
format(string, sizeof(string), " %s was kicked by AdmBot, reason: AFK longer than 30 minutes",name);
SendClientMessageToAll(0xAA3333AA,string);
}
}
}
}
return 1;
}
[/pawn]
am si eu un fs dupa ce stai 30 min afk sa primesti kick , stau afk mai mult de 30 min si tot nu primesc kick
www.ucp.gamesiasi.ro
Link to comment
Share on other sites
1 answer to this question
Recommended Posts