Gguiz007

Untitled

Apr 18th, 2020
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. public OnPlayerText(playerid, text[])
  2. {
  3. new string[126];
  4. if(text[0] == '!')
  5. {
  6. new Name[24], Msg[1000];
  7. GetPlayerName(playerid, Name, sizeof(Name));
  8. for (new i; i < MAX_PLAYERS; i++)
  9. {
  10. if (APlayerData[i][LoggedIn] == true)
  11. {
  12. if(APlayerData[playerid][PlayerLevel] >= 4)
  13. {
  14. if (APlayerData[i][PlayerLevel] >= 4)
  15. {
  16. format(Msg, 1000, "{EEC591}* {00FFFF}%s (id: %i): {EEC591}%s", Name, playerid, text[1]);
  17. SendClientMessage(i, 0xFFFFFFFF, Msg);
  18. }
  19. }
  20. }
  21. }
  22. return 0;
  23. }
  24. if(text[0] == ';')
  25. {
  26. new chat[9000];
  27. format(chat, sizeof(chat), "%s",text);
  28. new output[9000], pNameX[MAX_PLAYER_NAME],outadm[9000],rawstring[9000];
  29. GetPlayerName(playerid, pNameX, sizeof(pNameX));
  30.  
  31. format(output, sizeof(output), "{228B22}× %s [id: {FFFFFF}%i{228B22}] diz: {FFFFFF}%s", pNameX, playerid, text[1]);
  32. format(rawstring, sizeof(rawstring), "%s",string);
  33.  
  34. new Float:PosicaoX, Float:PosicaoY, Float:PosicaoZ;
  35. GetPlayerPos(playerid, PosicaoX, PosicaoY, PosicaoZ);
  36.  
  37. format(outadm, sizeof(outadm), "{228B22}× {228B22}| {FFFFFF}ChatProximo {228B22}| {228B22}%s [id: {FFFFFF}%i{228B22}] diz: {FFFFFF}%s", pNameX,playerid,text[1]);
  38. foreach(Player, i){if(IsPlayerConnected(i)){
  39. if(APlayerData[i][PlayerLevel] >= 4){
  40. if(!IsPlayerInRangeOfPoint(i, 20.0, PosicaoX, PosicaoY, PosicaoZ)){
  41. SendClientMessage(i, -1, outadm);}}}}
  42.  
  43. foreach(Player, i){if(IsPlayerConnected(i)){
  44. if(IsPlayerInRangeOfPoint(i, 20.0, PosicaoX, PosicaoY, PosicaoZ)){
  45. SendClientMessage(i, -1, output);
  46. PlayerPlaySound(i,1057,0.0,0.0,0.0);}}}
  47. SetPlayerChatBubble(playerid, rawstring, 0x00FFFFFF, 20.0, 10000);
  48. return 0;
  49. }
  50. return 1;
  51. }
Advertisement
Add Comment
Please, Sign In to add comment