13.11.2010, 14:03
(
Last edited by knackworst; 09/12/2010 at 02:12 PM.
)
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
-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:
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
pawn Code:
new Text3D:label[MAX_PLAYERS];
- next go to OnPlayerCommandText in your GameMode and und
pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
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;
}
ok, if you have any further questions, feel free to ask ; )