[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
#2

Update so the player that is AFK cant talk.
And show a game text to all about who's afk!
Reply
#3

Nice, Downloading now
Reply
#4

Quote:
Originally Posted by ColdXX
View Post
Update so the player that is AFK cant talk.
And show a game text to all about who's afk!
There already is gametext, but it's not gametext, it's just clientmessage for all, I think gametext will be annoying...

And, I'll try the no talking command...
Reply
#5

not hard to do
1- tutorial you made is moving object with another tutorial like that is existent
2- there are billions of afk systems
only thing cool is your map
Reply
#6

Quote:
Originally Posted by dark_clown
View Post
not hard to do
1- tutorial you made is moving object with another tutorial like that is existent
2- there are billions of afk systems
only thing cool is your map
So, if a tutorial is not hard, then you may not post it?
that's just bullshit!
Reply
#7

Quote:
Originally Posted by ColdXX
View Post
Update so the player that is AFK cant talk.
And show a game text to all about who's afk!
That would be very fucking annoying.

Quote:
Originally Posted by dark_clown
View Post
not hard to do
1- tutorial you made is moving object with another tutorial like that is existent
2- there are billions of afk systems
only thing cool is your map
Why do you got to flame him? Is it becuase you have no life and need to sit back and flame other people for fun? Please stop.

1) Who gives a shit, it's a tutorial right that may help someone new. So shutup.
2) There arn't that many AFK systems. So stfu and don't get all pissed that he made it before you did. Or whatever your made about.
Reply
#8

Quote:
Originally Posted by Steven82
View Post
That would be very fucking annoying.



Why do you got to flame him? Is it becuase you have no life and need to sit back and flame other people for fun? Please stop.

1) Who gives a shit, it's a tutorial right that may help someone new. So shutup.
2) There arn't that many AFK systems. So stfu and don't get all pissed that he made it before you did. Or whatever your made about.
your a freaking no life do you want me to make a afk system in your front with team viewer?
Reply
#9

Stop flaming kiddo's, both of you.
Reply
#10

Nice FS man!Keep up good work.
Reply
#11

Nice and simple.
Reply
#12

Quote:
Originally Posted by ColdXX
View Post
Update so the player that is AFK cant talk.
And show a game text to all about who's afk!
No, just set virtual world when he goes afk to 1 or 2
Reply
#13

Quote:
Originally Posted by dark_clown
View Post
your a freaking no life do you want me to make a afk system in your front with team viewer?
I never said they were hard to make, i just said who cares if more than 1 afk system is made. If it's his first or second release let it go man.
Reply
#14

Quote:
Originally Posted by Steven82
View Post
I never said they were hard to make, i just said who cares if more than 1 afk system is made. If it's his first or second release let it go man.
yes, it's my first release...
so I may not make any more FS's if there are already alot of them?
I didn't know that :S sorry man...
Reply
#15

Quote:
Originally Posted by Steven82
View Post
That would be very fucking annoying.
Umm nah,u can add the TextDraw in the down right corner of ur screen,i edited it with knackworst permision and its working just perfect. :P
Reply
#16

I like ColdXX's edit : P can you send me so I can use myself?
Reply
#17

Yea sure...
Reply
#18

Ontopic: Nice.

Offtopic: Dark_Clown why don't you read the tutorial if its not hard to make?
Maybe you're just a script copier.
Reply
#19

EDIT

_______________

Made a little tut to set it in your GM
Reply
#20

Quote:
Originally Posted by expertprogrammer
View Post
Ontopic: Nice.

Offtopic: Dark_Clown why don't you read the tutorial if its not hard to make?
Maybe you're just a script copier.
Uh... He's been banned - why are you still talking to him?
Reply


Forum Jump:


Users browsing this thread: 6 Guest(s)