#include <a_samp>#define yellow 0xFFFF00AA#define COLOR_YELLOW 0xFFFF00AAnew Text3D:label[MAX_PLAYERS]; public OnFilterScriptInit(){ print(\"\\n--------------------------------------\"); print(\" Afk SYSTEM\"); print(\"--------------------------------------\\n\"); return 1;}public OnPlayerCommandText(playerid, cmdtext[]){ 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; } return 0;}
#include <a_samp>#define yellow 0xFFFF00AA#define COLOR_YELLOW 0xFFFF00AAnew Text3D:label[MAX_PLAYERS],IsPlayerAway[MAX_PLAYERS]; public OnFilterScriptInit(){ print(\"\\n--------------------------------------\"); print(\" Afk SYSTEM\"); print(\"--------------------------------------\\n\"); return 1;}public OnPlayerCommandText(playerid, cmdtext[]){if(IsPlayerAway[playerid] && (strcmp(cmdtext, \"/back\", true) != 0)) return SendClientMessage(playerid, -1, \"AFK vagy, térj vissza a \'/back\' paranccsal\"), 1;if(strcmp(\"/afk\", cmdtext, true) == 0){ new string3[70], name[MAX_PLAYER_NAME];if(IsPlayerAway[playerid]) return SendClientMessage(playerid, -1, \"már elmentél.\");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);GetPlayerName(playerid, name, sizeof(name));TogglePlayerControllable(playerid, false);IsPlayerAway[playerid] = true;format(string3, sizeof(string3), \"%s is now Away from the keyboard!\", name);SendClientMessageToAll(COLOR_YELLOW, string3);return 1;}if(strcmp(\"/back\", cmdtext, true) == 0){ new string3[70], name[MAX_PLAYER_NAME];if(!IsPlayerAway[playerid]) return SendClientMessage(playerid, -1, \"el sem mentél.\");SendClientMessage(playerid, COLOR_YELLOW, \"You are now back!\");TogglePlayerControllable(playerid,1);GetPlayerName(playerid, name, sizeof(name));format(string3, sizeof(string3), \"%s is now Back!\", name);SendClientMessageToAll(COLOR_YELLOW, string3);TogglePlayerControllable(playerid, true);IsPlayerAway[playerid] = false;Delete3DTextLabel(label[playerid]);return 1;}if(strcmp(cmdtext, \"/asd\", true) == 0) return SendClientMessage(playerid, -1, \"asd\");return 0;}