Advertisement
Guest User

Afk System

a guest
May 4th, 2011
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. //Afk System by Francesco_Ronaldo aka The_Blade. Non rimuovere i crediti / Don't remove credits.
  2.  
  3. //Fuori da ogni callback
  4. new Text3D: Afk[MAX_PLAYERS];
  5. new bool: AFK[MAX_PLAYERS];
  6. #define VERDE 0x33AA33AA
  7. #define BLU_CHIARO 0x00BFFFAA
  8. #define ROSA 0xFF66FFAA
  9.  
  10. //OnPlayerConnect
  11. AFK[playerid] = false;
  12.  
  13. //OnPlayerCommandText
  14. if(!strcmp(cmdtext, "/afk", true))
  15. {
  16. if(AFK[playerid] == false)
  17. {
  18. new Float: Px, Float: Pz, Float: Py;
  19. GetPlayerPos(playerid, Px, Py, Pz);
  20. format(stringa, sizeof(stringa), "%s: Away From Keyboard", nome);
  21. Afk[playerid] = Create3DTextLabel(stringa, ROSA, Px, Py, Pz+1, 30, 0);
  22. TogglePlayerControllable(playerid, 0);
  23. AFK[playerid] = true;
  24. SendClientMessage(playerid, VERDE, "* {FFFFFF}Sei passato in stato AFK.");
  25. GetPlayerName(playerid, nome, 24);
  26. format(stringa, sizeof(stringa), "** {FFFFFF}%s{00BFFF} entra in stato AFK.", nome);
  27. SendClientMessageToAll(BLU_CHIARO, stringa);
  28. }
  29. else
  30. {
  31. AFK[playerid] = false;
  32. Delete3DTextLabel(Afk[playerid]);
  33. GetPlayerName(playerid, nome, 24);
  34. format(stringa, sizeof(stringa), "** {FFFFFF}%s{00BFFF} esce dallo stato AFK.", nome);
  35. SendClientMessageToAll(BLU_CHIARO, stringa);
  36. SendClientMessage(playerid, VERDE, "* {FFFFFF}Sei uscito dallo stato AFK.");
  37. TogglePlayerControllable(playerid, 1);
  38. }
  39.  
  40. return 1;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement