Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*-----------------------------------------------------------------------------*
- |
- ___ _ |
- / __) | _ |
- _____ _| |__| | _ ___ _ _ ___ _| |_ _____ ____ _____ |
- (____ (_ __) |_/ ) /___) | | |/___|_ _) ___ | \| ___ | |
- / ___ | | | | _ ( |___ | |_| |___ | | |_| ____| | | | ____| |
- \_____| |_| |_| \_) (___/ \__ (___/ \__)_____)_|_|_|_____) |
- (____/ |
- |
- I present my filterscript to you, it is a simple script of away from keyboard |
- (AFK sytem).. it's really simple to use, please don't remove credits. |
- |
- *------------------------------------------------------------------------------*
- | Includes & Scripitng Credits : |
- | |
- | A great thnaks to the SA:MP Teams for the #include <a_samp> |
- | * Thanks to, Jeaniscrazzy for this away from keyboard scripts |
- | |
- *-----------------------------------------------------------------------------*/
- #include <a_samp>
- /*-----------------------------------------------------------------------------*
- We will use it, when a player type away from keyboard info aka /afkinfo |
- *-----------------------------------------------------------------------------*/
- new afkinfo[1000];
- /*-----------------------------------------------------------------------------*
- We will use it, for the dialogs "reasons" of the afk mods |
- *-----------------------------------------------------------------------------*/
- #define AFK 30
- /*-----------------------------------------------------------------------------*
- Samp-server.exe black box copyrigth message of the owner of the scripts (jIc) |
- *-----------------------------------------------------------------------------*/
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- print("\n-------------------------------------------");
- print(" The script is ready to be used, loading... ");
- print(" • Away from keyboard system by Jeaniscrazzy!");
- print("-------------------------------------------\n");
- return 1;
- }
- #endif
- /*-----------------------------------------------------------------------------*
- OnPlayerConnect, message will send and informations abouts our sexy afk system |
- *-----------------------------------------------------------------------------*/
- public OnPlayerConnect(playerid)
- {
- SendClientMessage(playerid,0x0080C0C8,"* A simple away from keyboard system, by jIc | Use: /afkinfo , /afk , /back *");
- // jIc (It's the abreviations of my names nicknames jeanIscrazzy)
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- /*-----------------------------------------------------------------------------*
- /AFKINFO Commands, for more info about AFKmods
- *-----------------------------------------------------------------------------*/
- if (strcmp("/afkinfo", cmdtext, true, 10) == 0)
- {
- strcat(afkinfo,"{96B748}\n Rules of this system :");
- strcat(afkinfo,"{5E86A2}\n - You can't spamming with the afk mods, or you will be kicked,");
- strcat(afkinfo,"{5E86A2}\n - Don't use the afk mods when you see you damages or will die.");
- strcat(afkinfo,"\n");
- strcat(afkinfo,"{96B748}\n How to use it :");
- strcat(afkinfo,"{5E86A2}\n - If you are away from key board mods, please type: /afk");
- strcat(afkinfo,"{5E86A2}\n - If you are back, from your afks mods, please type: /back");
- {
- ShowPlayerDialog(playerid, 45, DIALOG_STYLE_MSGBOX, "Away From Keyboard -Informations :", afkinfo, "Okay", "");
- }
- return 1;
- }
- /*-----------------------------------------------------------------------------*
- /BACK COMMANDS FOR USERS WHO IS BACK FROM AFK
- *-----------------------------------------------------------------------------*/
- if (strcmp("/back", cmdtext, true, 10) == 0)
- {
- SendClientMessage(playerid,0x4DB357C8,"Welcome back, you are now back of your afk mods. Have fun");
- SetPlayerHealth(playerid, 100);
- SpawnPlayer(playerid);
- UnFreezePlayer(playerid);
- return 1;
- }
- /*-----------------------------------------------------------------------------*
- /AFK FOR A PLAYER WHEN HE HES AWAY FROM KEYBOARD
- *-----------------------------------------------------------------------------*/
- if (strcmp("/afk", cmdtext, true, 10) == 0)
- {
- FreezePlayer(playerid);
- ShowPlayerDialog(playerid,AFK,DIALOG_STYLE_INPUT,"{4480BB}Why you will be AFK?","{FFFFFF}You will be away from keyboard, but\nplease enter a reasons for your afk mods.","Okai","Cancel");
- }
- return 0;
- }
- /*-----------------------------------------------------------------------------*
- DIALOG RESPONSE FOR SEND AFK REASONS TO ALL
- *-----------------------------------------------------------------------------*/
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == AFK)
- {
- if(response)
- {
- SetPlayerHealth(playerid, 99999);
- new str[200];
- GetPlayerName(playerid, str, sizeof(str));
- format(str, sizeof(str), "{E6E61A}AFK-Informations: {FF80FF}%s{4480BB}(ID:{4DB34D}%d){4480BB} is now AFK | {4DB34D}Reasons: {4480BB}%s",str,playerid,inputtext[0]);
- SendClientMessageToAll(-1, str);
- }
- }
- return 1;
- }
- /******************************************************************************/
- stock FreezePlayer(playerid) // Freeze Player
- {
- TogglePlayerControllable(playerid, 0);
- }
- stock UnFreezePlayer(playerid) // UnFreezer Player
- {
- TogglePlayerControllable(playerid, 1);
- }
- /*******************************************************************************/
- /*-----------------------------------------------------------------------------*
- Here is the end of our awesome script, have fun with this I'm happy if you, |
- download it and use it on your server! Thanks you a lots, Jeaniscrazzy. |
- *-----------------------------------------------------------------------------*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement