Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /***********************************************
- * roAFK - Afficient AFK System Inc. *
- * @Author: RollTi *
- * @Version: v1.0 *
- * Very Special Thanks to: *
- * - Meta for helping in GetPlayerAFKToggle *
- * - RollTi (me) for scripting roAFK.inc *
- * - iPLEOMAX for giving some good tips/hint *
- * *
- **********************************************/
- #if defined _roAFK_included
- #endinput
- #endif
- #define _roAFK_included
- #include <a_samp>
- #include <YSI\y_hooks>
- new bool:AFKing[MAX_PLAYERS char],
- AFKTimer[MAX_PLAYERS];
- forward OnPlayerAFK(playerid);
- /*
- native TogglePlayerAFK(playerid, toggle);
- native GetPlayerAFK(playerid);
- */
- #if defined _FILTERSCRIPT_
- hook roAFK_OnFilterScriptInit()
- {
- print("Your filterscript is using RollTi's Afficient AFK v1.0");
- }
- #else
- hook roAFK_OnGameModeInit()
- {
- print("Your gamemode is using RollTi's Afficient AFK v1.0");
- }
- #endif
- stock TogglePlayerAFK(playerid, bool:toggle)
- {
- static Float:hp; GetPlayerHealth(playerid, hp);
- if(!toggle)
- {
- TogglePlayerControllable(playerid, 1);
- SetPlayerHealth(playerid, hp);
- KillTimer(AFKTimer[playerid]);
- AFKing{playerid} = false;
- }
- if(toggle == true)
- {
- AFKTimer[playerid] = SetTimerEx("OnPlayerAFK", 60000*5, false, "d", playerid);
- SetPlayerHealth(playerid, 9999999.9);
- TogglePlayerControllable(playerid, 0);
- AFKing{playerid} = true;
- }
- return 1;
- }
- stock GetPlayerAFKToggle(playerid)
- {
- return AFKing{playerid};
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement