SA-MP Forums Archive
Auto AFK - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Auto AFK (/showthread.php?tid=101428)



Auto AFK - icezoor - 10.10.2009

Hello, I search after a script which make your name to [AFK] after you been away 30 seconds...

I mean if some minimize, I want to their name change to [AFK] automatic...


I know this is possible... but Iґdont know how...

Plz Help!


Re: Auto AFK - Dark_Kostas - 10.10.2009

First you need an AFK system(kick for example. But you have to remove the kick).
Then after you see if player is afk you can do this.
pawn Код:
new name[MAX_PLAYER_NAME], string[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "[AFK]%s", name);
SetPlayerName(playerid, string);
I am 99% sure this will work. If it doesnt work, you can get this as an example.