SA-MP Forums Archive
[FilterScript] Simple AFK System. - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Simple AFK System. (/showthread.php?tid=251037)



Simple AFK System. [v0.8] - dewilix - 25.04.2011

Simple AFK System.

This is my first filterscript.

Features:
Commands: INFO:
You can change auto-afk time here:
Код:
#define afktime 1 // AFK time in minutes
You can enable/disable auto-afk here:
Код:
#define AutoAFKTimer 1 // Enable Auto AFK? 1 = On 0 = Off
You can enable/disable Back on Key Press here:
Код:
#define AutoBackOnButtonPress 1 // Enable Auto Back on "Move Forward" key press? 1 = On 0 = Off
Bugs:
If there is any bug send me pm.

Current version: 0.8

Changelog:
Код:
v0.8
-Bug fix
v0.7
-"Auto Back" now work with almost every movement key.
-Added [AFK] tag to player.
-Added Armour restore.
v0.6
-Added "Auto Back" when press move forward key.
-Added Enable/Disable "Auto Back".
-Added Enable/Disable Auto AFK.
v0.5
-Added auto afk.
v0.4
-Added anti-chat when afk.
-Fixed anti-spam now work.
v0.3
-Added anti-spam.
v0.2
-Fixed string size.
-Added return previous health.
v0.1
-Initial release.
Download: Pastebin v0.8
Download: Pastebin v0.7 | MediaFire v0.7
Download: Pastebin v0.6 | MediaFire v0.6
Download: Pastebin v0.5
Download: Pastebin v0.4


Re: Simple AFK System. - [ISS]Daniele_Tom - 25.04.2011

Nice


Re: Simple AFK System. - dewilix - 25.04.2011

Quote:
Originally Posted by [ISS]Daniele_Tom
Посмотреть сообщение
Nice
Thanks


Re: Simple AFK System. - sniperwars - 26.04.2011

Nice AFK system


Re: Simple AFK System. - Markx - 26.04.2011

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/afk", cmdtext, true, 10) == 0)
{
    new string[256];
    GetPlayerName(playerid,gPlayers[playerid],MAX_PLAYER_NAME);
    SetPlayerHealth(playerid,hp);
    TogglePlayerControllable(playerid, 0);
    format(string,sizeof(string),"%s is afk!",gPlayers[playerid]);
    SendClientMessageToAll(COLOR_RED,string);
}
if (strcmp("/back", cmdtext, true, 10) == 0)
{
    new string[256];
    TogglePlayerControllable(playerid, 1);
    SetPlayerHealth(playerid,hp2);
    format(string,sizeof(string),"%s is back!",gPlayers[playerid]);
    SendClientMessageToAll(COLOR_YELLOW,string);
    return 1;
}
return 1;
}
1. Again a AFK System
2. Very bad scripted!


Re : Simple AFK System. - Varkoll_ - 26.04.2011

Is not bad Good job.


Re: Simple AFK System. - Mean - 26.04.2011

It's terribly scripted, string sizes are o_O.


Re: Simple AFK System. - Phanto90 - 26.04.2011

omg please stop to post afk "system" .. (2 command are not a system :/)
It would be nice an afk system checking when a player is automatically AFK and when back (for example by pressing any key or changing position)
This is the usual boring afk "system"


Re: Simple AFK System. - xRyder - 26.04.2011

Oh, God!

Like Mean said, what's up with string sizes?

Will this(down) ever use... 40 cells??
pawn Код:
format(string,sizeof(string),"%s is afk!",gPlayers[playerid]);
And your declaring it as 256 big cell...Why?

+

Why do you restart players HP when hes '/back' at 100?
When you don't actually know how many he had before going '/afk' (You didn't check for that).


Re: Simple AFK System. - Mean - 27.04.2011

Quote:
Originally Posted by xRyder
Посмотреть сообщение
Oh, God!

Like Mean said, what's up with string sizes?

Will this(down) ever use... 40 cells??
pawn Код:
format(string,sizeof(string),"%s is afk!",gPlayers[playerid]);
And your declaring it as 256 big cell...Why?

+

Why do you restart players HP when hes '/back' at 100?
When you don't actually know how many he had before going '/afk' (You didn't check for that).
The string size he needs is:
10 - 2 = 8
8 + 24 = 32
32 + 1 = 33

33, so why 256 o_O...