[FilterScript] AFK system
#1

AFK system


Features
  • -Command /afk
  • -Client message for all wich says: "Name of the person who used /afk" is now away from the keyboard!
  • -Client message for the player himself wich says: You are now AFK, type /back to move again!
  • -3D text label on the head of the player who used /AFK wich says: "AFK" In the color Yellow
  • -Toggeling player controlable, Player cannot move until he types /back
  • -Command /back
  • -Client message for all wich says: "Name of the person who used /back" is now back
  • -Client message for the player himself wich says: Welcome back!
  • -3D text label on the head of the player Deleted
  • -Toggeling player controlable again, player can move
Future edits will be:
-Auto AFK a player when he presses escape button
-Remove player from vehicle when he types /afk
-Remove player weapons on /afk
-Set player virtaul world on /afk
(very basic features... coming soon)


Credits:
I don't care about credits...

Pastebin:
http://pastebin.com/UYLQwTH6

Download: .amx
http://www.mediafire.com/?ytop8rty49g7ubj

DOwnload: .pwn

http://www.mediafire.com/?bdm8i3r9j91e42g


How to install:
Pastbein way:

-Open a new .pwn file, and replace everything in the new file with everything in the pastebin
-Then, save the file and go to your server.cfg and add: "the file name you gave the AFK system" behindthe filterscripts.

Download way:
  • Download both files and put them in your filterscripts folder in your server directory folder
  • Add: AFKsystem to your filterscripts line in the server.cfg



Converting into your Game Mode

If you rather put this in your gamemode instead of a new FS, that's possible too!
Here's what to do:
  • Open pawno two times
  • In one of them you open my new FS, by clicking: open/Filterscripts/afksystem
  • In the other pawno you open your GameMode
  • Now add :
    pawn Code:
    #define yellow 0xFFFF00AA
  • #define COLOR_YELLOW 0xFFFF00AA
under your other defines in your GM and add:
pawn Code:
new Text3D:label[MAX_PLAYERS];
under your other "new" in your GameMode
  • next go to OnPlayerCommandText in your GameMode and und
er:
pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
and right under that in your GM you add this:
pawn Code:
if(strcmp("/afk", cmdtext, true) == 0)
   {
   SendClientMessage(playerid, COLOR_YELLOW, "You are now AFK, type /back to move again!");
   TogglePlayerControllable(playerid,0);
   label[playerid] = Create3DTextLabel("AFK",yellow,30.0,40.0,50.0,40.0,0);
   Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.7);
   new string3[70];
   new name[MAX_PLAYER_NAME];
   GetPlayerName(playerid, name, sizeof(name));

   format(string3, sizeof(string3), "%s is now Away from the keyboard!", name);
   SendClientMessageToAll(COLOR_YELLOW, string3);
   }

   if(strcmp("/back", cmdtext, true) == 0)
   {
   SendClientMessage(playerid, COLOR_YELLOW, "You are now back!");
   TogglePlayerControllable(playerid,1);
   new string3[70];
   new name[MAX_PLAYER_NAME];
   GetPlayerName(playerid, name, sizeof(name));

   format(string3, sizeof(string3), "%s is now Back!", name);
   SendClientMessageToAll(COLOR_YELLOW, string3);
   Delete3DTextLabel(Text3D:label[playerid]);
   return 1;
   }
Make sure you add it right under it!

ok, if you have any further questions, feel free to ask ; )
Reply


Messages In This Thread
AFK system V1 - by knackworst - 13.11.2010, 14:03
Re: AFK system - by ColdXX - 13.11.2010, 14:09
Re: AFK system - by Noss* - 13.11.2010, 14:11
Re: AFK system - by knackworst - 13.11.2010, 14:20
Re: AFK system - by dark_clown - 13.11.2010, 15:21
Re: AFK system - by knackworst - 13.11.2010, 15:37
Re: AFK system - by Steven82 - 13.11.2010, 15:52
Re: AFK system - by dark_clown - 13.11.2010, 17:13
Re: AFK system - by Rzzr - 13.11.2010, 17:43
Re: AFK system - by oliver12 - 13.11.2010, 18:43
Re: AFK system - by Aleluja - 13.11.2010, 19:21
Re: AFK system - by Mean - 13.11.2010, 20:10
Re: AFK system - by Steven82 - 13.11.2010, 21:46
Re: AFK system - by knackworst - 13.11.2010, 22:54
Re: AFK system - by ColdXX - 19.11.2010, 19:47
Re: AFK system - by knackworst - 19.11.2010, 21:41
Re: AFK system - by ColdXX - 19.11.2010, 22:13
Re: AFK system - by Guest3598475934857938411 - 08.12.2010, 13:50
Re: AFK system - by knackworst - 08.12.2010, 14:20
Re: AFK system - by Scenario - 08.12.2010, 14:25
Re: AFK system - by Mean - 08.12.2010, 16:38
Re: AFK system - by knackworst - 08.12.2010, 19:40
Re: AFK system - by Mean - 13.12.2010, 17:11
Re: AFK system - by Alexman - 13.12.2010, 17:41
Re: AFK system - by Noss* - 21.12.2010, 19:41
Re: AFK system - by knackworst - 21.12.2010, 19:47
Re: AFK system - by Jochemd - 21.12.2010, 20:00
Re: AFK system - by knackworst - 21.12.2010, 22:01
Re: AFK system - by ZoinoZ88 - 03.01.2011, 02:33
Re: AFK system - by Toreno - 03.01.2011, 04:12
Re: AFK system - by Kerlan - 07.10.2011, 23:15
Re: AFK system - by Kerlan - 07.10.2011, 23:17
Re: AFK system - by THE_KING$5$ - 08.10.2011, 04:21
Re: AFK system - by Shooter3 - 08.10.2011, 12:43
Re: AFK system - by rvald8 - 17.07.2012, 07:54
Re: AFK system - by sajon. - 17.07.2012, 08:01
Re: AFK system - by fadhilkab - 17.07.2012, 08:18

Forum Jump:


Users browsing this thread: 1 Guest(s)