Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Filterscript created by: Phantom
- Credits:
- lelemaster for helping me while doing the script.
- V1ceC1ty for helping me while doing the script aswell.
- Akira297 for insipiring me to script.
- Note: If you release / use it on any webpage or gamemode give me credits.
- Feel free to Edit/remove/add lines of code to the FS.
- SA:MP Forums
- */
- #include <a_samp>
- new pAFK[MAX_PLAYERS] = 0;
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Away from keyboard FS Loaded");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- #else
- main()
- {
- print("\n----------------------------------");
- print(" Away from keyboard FS Unloaded");
- print("----------------------------------\n");
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/afk", cmdtext, true, 10) == 0)
- {
- if(pAFK[playerid] == 1)
- {
- SendClientMessage(playerid, 0xEFEFF7AA, "You are already AFK! As you typed this, it means you are back!");
- SetPlayerHealth(playerid, 100);
- pAFK[playerid] == 0;
- }
- else if(pAFK[playerid] == 0)
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "You are now AFK!");
- SetPlayerVirtualWorld(playerid, 69696969);
- pAFK[playerid] == 1;
- SetPlayerHealth(playerid, 9999999);
- }
- return 1;
- }
- if (strcmp("/back", cmdtext, true, 10) == 0)
- {
- if(pAFK[playerid] == 0)
- {
- SendClientMessage(playerid, 0xEFEFF7AA, "You are not even AFK!!");
- }
- else if(pAFK[playerid] == 1)
- {
- pAFK[playerid] == 0;
- SetPlayerVirtualWorld(playerid, 0);
- SetPlayerHealth(playerid, 100);
- SendClientMessage(playerid, 0xFFFFFFFF, "You are now back");
- }
- return 1;
- }
- return 0;
- }
- public OnPlayerDisconnect(playerid)
- {
- pAFK[playerid] = 0;
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- pAFK[playerid] == 0;
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement