Advertisement
Guest User

Untitled

a guest
Jul 4th, 2013
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.52 KB | None | 0 0
  1. //----------------------------------[Whisper]-----------------------------------------------
  2. if(strcmp(cmd, "/whisper", true) == 0 || strcmp(cmd, "/w", true) == 0)
  3. {
  4. if(IsPlayerConnected(playerid))
  5. {
  6. if(gPlayerLogged[playerid] == 0)
  7. {
  8. SendClientMessage(playerid, COLOR_GREY, " Niste se prijavili!");
  9. return 1;
  10. }
  11. tmp = strtok(cmdtext, idx);
  12. if(!strlen(tmp))
  13. {
  14. SendClientMessage(playerid, COLOR_GRAD2, "Koristi: (/w)hisper [ID Igraca/Deo Imena] [whisper text]");
  15. return 1;
  16. }
  17. giveplayerid = ReturnUser(tmp);
  18. if (IsPlayerConnected(giveplayerid))
  19. {
  20. if(giveplayerid != INVALID_PLAYER_ID)
  21. {
  22. new Float:x, Float:y, Float:z;
  23. GetPlayerPos(giveplayerid,x,y,z);
  24. if(PlayerToPoint(5, playerid, x, y, z))
  25. {
  26. GetPlayerName(playerid, sendername, sizeof(sendername));
  27. GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
  28. if(giveplayerid == playerid)
  29. {
  30. format(string, sizeof(string), "* %s brblja nesto sebi.", sendername);
  31. ProxDetector(5.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  32. }
  33. else
  34. {
  35. format(string, sizeof(string), "* %s sapce nesto %s-u", sendername, giveplayer);
  36. ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  37. }
  38. new length = strlen(cmdtext);
  39. while ((idx < length) && (cmdtext[idx] <= ' '))
  40. {
  41. idx++;
  42. }
  43. new offset = idx;
  44. new result[256];
  45. while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  46. {
  47. result[idx - offset] = cmdtext[idx];
  48. idx++;
  49. }
  50. result[idx - offset] = EOS;
  51. if(!strlen(result))
  52. {
  53. SendClientMessage(playerid, COLOR_GRAD2, "Koristi: (/w)isper [ID Igraca/Deo Imena] [whisper text]");
  54. return 1;
  55. }
  56. new brojevi[] = { '1','2','3','4','5','6','7','8','9'};
  57. for(new b = 0; b < sizeof brojevi; b++)
  58. {
  59. new tekst = strlen(result);
  60. for(new a = 0; a<tekst; a++)
  61. {
  62. if(result[a] == brojevi[b])
  63. result[a] = '*' ;
  64. }
  65. }
  66. format(string, sizeof(string), "%s sapce: %s", sendername, (result));
  67. SendClientMessage(giveplayerid, COLOR_YELLOW, string);
  68. format(string, sizeof(string), "%s sapce: %s", sendername, (result));
  69. SendClientMessage(playerid, COLOR_YELLOW, string);
  70. return 1;
  71. }
  72. else
  73. {
  74. SendClientMessage(playerid, COLOR_GREY, "Igrac nije blizu vas!");
  75. return 1;
  76. }
  77. }
  78. }
  79. else
  80. {
  81. format(string, sizeof(string), " %d nije aktivan igrac.", giveplayerid);
  82. SendClientMessage(playerid, COLOR_GRAD1, string);
  83. }
  84. }
  85. return 1;
  86. }
  87. //----------------------------------[Car Whisper]-----------------------------------------------
  88. if(strcmp(cmd, "/cw", true) == 0 || strcmp(cmd, "/carwhisper", true) == 0 || strcmp(cmd, "/cwhisper", true) == 0)
  89. {
  90. if(IsPlayerConnected(playerid))
  91. {
  92. if(gPlayerLogged[playerid] == 0)
  93. {
  94. SendClientMessage(playerid, COLOR_GREY, " Niste se prijavili!");
  95. return 1;
  96. }
  97. if(!IsPlayerInAnyVehicle(playerid))
  98. {
  99. SendClientMessage(playerid, COLOR_GREY, " Niste u autu!");
  100. return 1;
  101. }
  102. GetPlayerName(playerid, sendername, sizeof(sendername));
  103. new length = strlen(cmdtext);
  104. while ((idx < length) && (cmdtext[idx] <= ' '))
  105. {
  106. idx++;
  107. }
  108. new offset = idx;
  109. new result[64];
  110. while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  111. {
  112. result[idx - offset] = cmdtext[idx];
  113. idx++;
  114. }
  115. result[idx - offset] = EOS;
  116. if(!strlen(result))
  117. {
  118. SendClientMessage(playerid, COLOR_GRAD2, "Koristi: (/cw)hisper [text]");
  119. return 1;
  120. }
  121. new vehicle = GetPlayerVehicleID(playerid);
  122. foreach (Player, i)
  123. {
  124. if(IsPlayerInAnyVehicle(i))
  125. {
  126. if(GetPlayerVehicleID(i) == vehicle)
  127. {
  128. if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  129. {
  130. format(string, sizeof(string), "Vozac %s kaze: %s", sendername, result);
  131. SendClientMessage(i, 0xD7DFF3AA, string);
  132. }
  133. else
  134. {
  135. format(string, sizeof(string), "Putnik %s kaze: %s", sendername, result);
  136. SendClientMessage(i, 0xD7DFF3AA, string);
  137. }
  138. }
  139. }
  140. }
  141. }
  142. return 1;
  143. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement