Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <zcmd>
- new IsPlayerAfk[MAX_PLAYERS];
- CMD:afk(playerid, params[])
- {
- if(IsPlayerAfk[playerid] == 1) return SendClientMessage(playerid, -1, "{FF0000}You are already AFK");
- IsPlayerAfk[playerid] = 1;
- GameTextForPlayer(playerid, "~g~AFK",2000,3);
- SetPlayerHealth(playerid, 9999999999999999999.0);
- TogglePlayerControllable(playerid,0);
- return 1;
- }
- CMD:back(playerid,params[])
- {
- if(IsPlayerAfk[playerid] == 0) return SendClientMessage(playerid, -1, "{FF0000}You are not AFK");
- if(IsPlayerAfk[playerid] == 1)
- {
- IsPlayerAfk[playerid] = 0;
- SendClientMessage(playerid, -1,"{00CC00}You are back from AFK");
- SetPlayerHealth(playerid, 100);
- TogglePlayerControllable(playerid,1);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement