Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Afk System by Francesco_Ronaldo aka The_Blade. Non rimuovere i crediti / Don't remove credits.
- //Fuori da ogni callback
- new Text3D: Afk[MAX_PLAYERS];
- new bool: AFK[MAX_PLAYERS];
- #define VERDE 0x33AA33AA
- #define BLU_CHIARO 0x00BFFFAA
- #define ROSA 0xFF66FFAA
- //OnPlayerConnect
- AFK[playerid] = false;
- //OnPlayerCommandText
- if(!strcmp(cmdtext, "/afk", true))
- {
- if(AFK[playerid] == false)
- {
- new Float: Px, Float: Pz, Float: Py;
- GetPlayerPos(playerid, Px, Py, Pz);
- format(stringa, sizeof(stringa), "%s: Away From Keyboard", nome);
- Afk[playerid] = Create3DTextLabel(stringa, ROSA, Px, Py, Pz+1, 30, 0);
- TogglePlayerControllable(playerid, 0);
- AFK[playerid] = true;
- SendClientMessage(playerid, VERDE, "* {FFFFFF}Sei passato in stato AFK.");
- GetPlayerName(playerid, nome, 24);
- format(stringa, sizeof(stringa), "** {FFFFFF}%s{00BFFF} entra in stato AFK.", nome);
- SendClientMessageToAll(BLU_CHIARO, stringa);
- }
- else
- {
- AFK[playerid] = false;
- Delete3DTextLabel(Afk[playerid]);
- GetPlayerName(playerid, nome, 24);
- format(stringa, sizeof(stringa), "** {FFFFFF}%s{00BFFF} esce dallo stato AFK.", nome);
- SendClientMessageToAll(BLU_CHIARO, stringa);
- SendClientMessage(playerid, VERDE, "* {FFFFFF}Sei uscito dallo stato AFK.");
- TogglePlayerControllable(playerid, 1);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement