Advertisement
Guest User

Untitled

a guest
Oct 29th, 2010
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.29 KB | None | 0 0
  1. /*Arts Chatbox Kunterbunt, (c) by .Art.*/
  2.  
  3. #define FILTERSCRIPT
  4.  
  5. #include <a_samp>
  6. new Farbe[MAX_PLAYERS];
  7. #define Rot 0xAA3333AA
  8. #define Gruen 0x00CC33C0
  9. #define Blau 0x0000FFBA
  10. #define ChangeColor 1
  11. public OnFilterScriptInit()
  12. {
  13. print("\n--------------------------------------");
  14. print(" Blank Filterscript by your name here");
  15. print("--------------------------------------\n");
  16. return 1;
  17. }
  18.  
  19. public OnPlayerText(playerid, text[])
  20. {
  21. new string[256];
  22. new Float:spX, Float:spY, Float:spZ;
  23. GetPlayerPos(playerid, spX, spY, spZ);
  24. if(Farbe[playerid] == 1) {
  25. format(string, sizeof(string), "%s sagt: %s",ReadName(playerid),text);
  26. SendRadiusMessage(180.0, Blau, string, spX, spY, spZ);}
  27. else if(Farbe[playerid] == 2) {
  28. format(string, sizeof(string), "%s sagt: %s",ReadName(playerid),text);
  29. SendRadiusMessage(180.0, Gruen, string, spX, spY, spZ);}
  30. else if(Farbe[playerid] == 3) {
  31. format(string, sizeof(string), "%s sagt: %s",ReadName(playerid),text);
  32. SendRadiusMessage(180.0, Rot, string, spX, spY, spZ);}
  33. return 0;
  34. }
  35.  
  36. public OnPlayerCommandText(playerid, cmdtext[])
  37. {
  38. if (strcmp("/ChangeColor", cmdtext, true, 10) == 0)
  39. {
  40. ShowPlayerDialog(playerid, ChangeColor, DIALOG_STYLE_LIST, "Chatbox Kunterbunt", "Chatbox Blau\nChatbox Grün\nChatbox Rot", "Auswählen", "Abbrechen");
  41. return 1;
  42. }
  43. return 0;
  44. }
  45.  
  46. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  47. {
  48. if(dialogid == ChangeColor)
  49. {
  50. if(response)
  51. {
  52. if(listitem == 0)
  53. {
  54. Farbe[playerid] = 1;
  55. SendClientMessage(playerid, Blau, "Du schreibst nun Blau :)");
  56. }
  57. if(listitem == 1)
  58. {
  59. Farbe[playerid] = 2;
  60. SendClientMessage(playerid, Gruen, "Du schreibst nun Grün :)");
  61. }
  62. if(listitem == 2)
  63. {
  64. Farbe[playerid] = 3;
  65. SendClientMessage(playerid, Rot, "Du schreibst nun Rot :)");
  66. }
  67. }
  68. return 1;
  69. }
  70. return 1;
  71. }
  72.  
  73. stock SendRadiusMessage(Float:radius, color, string[], Float:x, Float:y, Float:z)
  74. {
  75. for(new i=0; i<MAX_PLAYERS; i++)
  76. {
  77. if(IsPlayerConnected(i) && !IsPlayerNPC(i))
  78. {
  79. if(IsPlayerInRangeOfPoint(i, radius, x, y, z))
  80. {
  81. SendClientMessage(i, color, string);
  82. }
  83. }
  84. }
  85. return 0;
  86. }
  87. stock ReadName(playerid)
  88. {
  89. new playername[24];
  90. GetPlayerName(playerid, playername, 24);
  91. return playername;
  92. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement