Advertisement
Guest User

DarkRaver

a guest
Mar 26th, 2009
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.52 KB | None | 0 0
  1. //Dieses Script wurde in 5 Minuten von DarkRaver gebaut !
  2.  
  3. #include <a_samp>
  4. #define Farbe_Fade1 0xE6E6E6E6
  5. #define Farbe_Fade2 0xC8C8C8C8
  6. #define Farbe_Fade3 0xAAAAAAAA
  7. #define Farbe_Fade4 0x8C8C8C8C
  8. #define Farbe_Fade5 0x6E6E6E6E
  9. #define Farbe_Orange 0xFF9900FF
  10. new LocalChatOn[MAX_PLAYERS];
  11. new BigEar[MAX_PLAYERS];
  12.  
  13. public OnPlayerConnect(playerid)
  14. {
  15. LocalChatOn[playerid] = 1;
  16. }
  17.  
  18. public OnPlayerText(playerid, text[])
  19. {
  20. if(LocalChatOn[playerid] == 0)
  21. {
  22. new Nachricht[256];
  23. format(Nachricht, sizeof(Nachricht), "%s sagt an alle: %s", playerid, Nachricht);
  24. SendClientMessageToAll(Farbe_Fade1, Nachricht);
  25. }
  26. if(LocalChatOn[playerid] == 1)
  27. {
  28. new Nachricht[256];
  29. format(Nachricht, sizeof(Nachricht), "%s sagt: %s", playerid, Nachricht);
  30. ProxDetector(15.0, playerid, Nachricht,Farbe_Fade1,Farbe_Fade2,Farbe_Fade3,Farbe_Fade4,Farbe_Fade5);
  31. }
  32. return 0;
  33. }
  34.  
  35. public OnPlayerCommandText(playerid, cmdtext[])
  36. {
  37. new cmd[256];
  38. if(strcmp(cmd,"/localchat",true) ==0)
  39. {
  40. if(IsPlayerConnected(playerid))
  41. {
  42. if(LocalChatOn[playerid] == 1)
  43. {
  44. LocalChatOn[playerid] = 0;
  45. SendClientMessage(playerid, Farbe_Orange, "Dein Lokaler Chat wurde ausgeschaltet !");
  46. SendClientMessage(playerid, Farbe_Orange, "Wenn du jetzt etwas schreibst k�nnen es alle sehen !");
  47. }
  48. else
  49. {
  50. LocalChatOn[playerid] = 1;
  51. SendClientMessage(playerid, Farbe_Orange, "Dein Lokaler Chat wurde eingeschaltet !");
  52. SendClientMessage(playerid, Farbe_Orange, "Wenn du jetzt etwas schreibst k�nnen es nur die sehen, die in der Umgebung sind !");
  53. }
  54. }
  55. }
  56. }
  57. forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
  58. public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
  59. {
  60. if(IsPlayerConnected(playerid))
  61. {
  62. new Float:posx, Float:posy, Float:posz;
  63. new Float:oldposx, Float:oldposy, Float:oldposz;
  64. new Float:tempposx, Float:tempposy, Float:tempposz;
  65. GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  66. //radi = 2.0; //Trigger Radius
  67. for(new i = 0; i < MAX_PLAYERS; i++)
  68. {
  69. if(IsPlayerConnected(i))
  70. {
  71. if(!BigEar[i])
  72. {
  73. GetPlayerPos(i, posx, posy, posz);
  74. tempposx = (oldposx -posx);
  75. tempposy = (oldposy -posy);
  76. tempposz = (oldposz -posz);
  77. //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
  78. if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
  79. {
  80. SendClientMessage(i, col1, string);
  81. }
  82. else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
  83. {
  84. SendClientMessage(i, col2, string);
  85. }
  86. else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
  87. {
  88. SendClientMessage(i, col3, string);
  89. }
  90. else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
  91. {
  92. SendClientMessage(i, col4, string);
  93. }
  94. else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  95. {
  96. SendClientMessage(i, col5, string);
  97. }
  98. }
  99. else
  100. {
  101. SendClientMessage(i, col1, string);
  102. }
  103. }
  104. }
  105. }//not connected
  106. return 1;
  107. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement