[FilterScript] Simple AFK System.
#1

Simple AFK System.

This is my first filterscript.

Features:
  • Saves your score from losing, when you are away from keyboard.
  • Returns your previous health.
  • Auto AFK after specific time.
  • "Back" without using commands by pressing "move forward" key.
Commands:
  • /afk
  • /back
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
Reply
#2

Nice
Reply
#3

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

Nice AFK system
Reply
#5

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!
Reply
#6

Is not bad Good job.
Reply
#7

It's terribly scripted, string sizes are o_O.
Reply
#8

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"
Reply
#9

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).
Reply
#10

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...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)