Advertisement
Guest User

Untitled

a guest
Apr 15th, 2011
278
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. format(stringa, sizeof(stringa), "** {FFFFFF}%s{00BFFF} entra in stato AFK.", nome);
  26. SendClientMessageToAll(BLU_CHIARO, stringa);
  27. }
  28. else
  29. {
  30. AFK[playerid] = false;
  31. Delete3DTextLabel(Afk[playerid]);
  32. format(stringa, sizeof(stringa), "** {FFFFFF}%s{00BFFF} esce dallo stato AFK.", nome);
  33. SendClientMessageToAll(BLU_CHIARO, stringa);
  34. SendClientMessage(playerid, VERDE, "* {FFFFFF}Sei uscito dallo stato AFK.");
  35. TogglePlayerControllable(playerid, 1);
  36. }
  37.  
  38. return 1;
  39. }
Advertisement
RAW Paste Data Copied
Advertisement