Guest User

Untitled

a guest
Apr 28th, 2010
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.34 KB | None | 0 0
  1. public OnPlayerText(playerid, text[])
  2. {
  3. format(LastText[playerid], strlen(text)+1, "%s", text);
  4. if(Mobile[playerid] != 255)
  5. {
  6. new string [128];
  7. new sendername[MAX_PLAYER_NAME];
  8. new idx;
  9. new tmp[MAX_PLAYER_NAME];
  10. tmp = strtok(text, idx);
  11. GetPlayerName(playerid, sendername, sizeof(sendername));
  12. format(string, sizeof(string), "%s Says (cellphone): %s", sendername, text);
  13. ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
  14. if(Mobile[playerid] == 920)
  15. {
  16. strmid(rrresult[playerid], text, 0, strlen(text), 255);
  17. format(string, sizeof(string), "EMERGENCY: Thankyou %s, please stay calm, our units are on their way!", reportername[playerid]);
  18. SendClientMessage(playerid, COLOR_ALLDEPT, string);
  19. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
  20. Mobile[playerid] = 255;
  21. format(string, sizeof(string), "HQ: Caller: %s. Location: %s",reportername[playerid], rrresult[playerid]);
  22. SendTeamBeepMessage(1, COLOR_ALLDEPT, string);
  23. SendTeamBeepMessage(2, COLOR_DBLUE, string);
  24. format(string, sizeof(string), "HQ: Situation: %s",rresult[playerid]);
  25. SendTeamBeepMessage(1, COLOR_ALLDEPT, string);
  26. SendTeamBeepMessage(2, COLOR_DBLUE, string);
  27. return 0;
  28. }
  29. if(Mobile[playerid] == 919)
  30. {
  31. strmid(rresult[playerid], text, 0, strlen(text), 255);
  32. format(string, sizeof(string), "EMERGENCY: Finally %s, what is your current location?", reportername[playerid]);
  33. SendClientMessage(playerid, COLOR_ALLDEPT, string);
  34. Mobile[playerid] = 920;
  35. return 0;
  36. }
  37. if(Mobile[playerid] == 918)
  38. {
  39. if(!strlen(tmp))
  40. {
  41. SendClientMessage(playerid, COLOR_ALLDEPT, "EMERGENCY: Sorry i don't understand, what is your Name?");
  42. return 0;
  43. }
  44. else
  45. {
  46. strmid(reportername[playerid], tmp, 0, strlen(text), 255);
  47. format(string, sizeof(string), "EMERGENCY: Okay %s, what seems to be the problem?", reportername[playerid]);
  48. SendClientMessage(playerid, COLOR_ALLDEPT, string);
  49. Mobile[playerid] = 919;
  50. return 0;
  51. }
  52. }
  53. if(Mobile[playerid] == 917)
  54. {
  55. strmid(rrresult[playerid], text, 0, strlen(text), 255);
  56. format(string, sizeof(string), "PARAMEDIC: Thankyou %s, please stay calm, our units are on their way!", reportername[playerid]);
  57. SendClientMessage(playerid, COLOR_ALLDEPT, string);
  58. Mobile[playerid] = 255;
  59. format(string, sizeof(string), "HQ: Caller: %s. Location: %s",reportername[playerid], rrresult[playerid]);
  60. SendTeamBeepMessage(1, COLOR_ALLDEPT, string);
  61. format(string, sizeof(string), "HQ: Situation: %s",rresult[playerid]);
  62. SendTeamBeepMessage(1, COLOR_ALLDEPT, string);
  63. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
  64. return 0;
  65. }
  66. if(Mobile[playerid] == 916)
  67. {
  68. strmid(rresult[playerid], text, 0, strlen(text), 255);
  69. format(string, sizeof(string), "PARAMEDIC: Finally %s, what is your current location?", reportername[playerid]);
  70. SendClientMessage(playerid, COLOR_ALLDEPT, string);
  71. Mobile[playerid] = 917;
  72. return 0;
  73. }
  74. if(Mobile[playerid] == 915)
  75. {
  76. if(!strlen(tmp))
  77. {
  78. SendClientMessage(playerid, COLOR_ALLDEPT, "PARAMEDIC: Sorry i don't understand, what is your Name?");
  79. return 0;
  80. }
  81. else
  82. {
  83. strmid(reportername[playerid], tmp, 0, strlen(text), 255);
  84. format(string, sizeof(string), "PARAMEDIC: Okay %s, what seems to be the problem?", reportername[playerid]);
  85. SendClientMessage(playerid, COLOR_ALLDEPT, string);
  86. Mobile[playerid] = 916;
  87. return 0;
  88. }
  89. }
  90. if(Mobile[playerid] == 914)
  91. {
  92. strmid(rrresult[playerid], text, 0, strlen(text), 255);
  93. format(string, sizeof(string), "POLICE: Thankyou %s, please stay calm, our units are on their way!", reportername[playerid]);
  94. SendClientMessage(playerid, COLOR_DBLUE, string);
  95. Mobile[playerid] = 255;
  96. format(string, sizeof(string), "HQ: Caller: %s. Location: %s",reportername[playerid], rrresult[playerid]);
  97. SendTeamBeepMessage(2, COLOR_DBLUE, string);
  98. format(string, sizeof(string), "HQ: Situation: %s",rresult[playerid]);
  99. SendTeamBeepMessage(2, COLOR_DBLUE, string);
  100. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
  101. return 0;
  102. }
  103. if(Mobile[playerid] == 913)
  104. {
  105. strmid(rresult[playerid], text, 0, strlen(text), 255);
  106. format(string, sizeof(string), "POLICE: Finally %s, what is your current location?", reportername[playerid]);
  107. SendClientMessage(playerid, COLOR_DBLUE, string);
  108. Mobile[playerid] = 914;
  109. return 0;
  110. }
  111. if(Mobile[playerid] == 912)
  112. {
  113. strmid(reportername[playerid], text, 0, strlen(text), 255);
  114. format(string, sizeof(string), "POLICE: Okay %s, what seems to be the problem?", reportername[playerid]);
  115. SendClientMessage(playerid, COLOR_DBLUE, string);
  116. Mobile[playerid] = 913;
  117. return 0;
  118. }
  119. if(Mobile[playerid] == 911)
  120. {
  121. if(!strlen(tmp))
  122. {
  123. SendClientMessage(playerid, COLOR_ALLDEPT, "EMERGENCY: Sorry I dont understand, police, paramedic or both?");
  124. return 0;
  125. }
  126. else if ((strcmp("police", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("police")))
  127. {
  128. Mobile[playerid] = 912;
  129. SendClientMessage(playerid, COLOR_DBLUE, "POLICE: Hello Sir/Madam, please give me your name.");
  130. return 0;
  131. }
  132. else if ((strcmp("paramedic", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("paramedic")))
  133. {
  134. Mobile[playerid] = 915;
  135. SendClientMessage(playerid, COLOR_ALLDEPT, "PARAMEDIC: Hello Sir/Madam, please give me your name.");
  136. return 0;
  137. }
  138. else if ((strcmp("both", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("both")))
  139. {
  140. Mobile[playerid] = 918;
  141. SendClientMessage(playerid, TEAM_CYAN_COLOR, "EMERGENCY: Hello Sir/Madam, please give me your name.");
  142. return 0;
  143. }
  144. else
  145. {
  146. SendClientMessage(playerid, COLOR_ALLDEPT, "EMERGENCY: Sorry I dont understand, police, paramedic or both?");
  147. return 0;
  148. }
  149. }
  150. if(IsPlayerConnected(Mobile[playerid]) == 1 && Mobile[Mobile[playerid]] == playerid)
  151. {
  152. SendClientMessage(Mobile[playerid], COLOR_YELLOW,string);
  153. }
  154. else
  155. {
  156. SendClientMessage(playerid, COLOR_YELLOW,"Theres nobody there");
  157. }
  158. return 0;
  159. }
  160. if (realchat)
  161. {
  162. if(accent[playerid] == 0)
  163. {
  164. new string[256];
  165. new sendername[MAX_PLAYER_NAME];
  166. GetPlayerName(playerid, sendername, sizeof(sendername));
  167. format(string, sizeof(string), "%s Says %s", sendername, text);
  168. ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
  169. return 1;
  170. }
  171. else if(accent[playerid] == 1)
  172. {
  173. new string[256];
  174. new sendername[MAX_PLAYER_NAME];
  175. GetPlayerName(playerid, sendername, sizeof(sendername));
  176. format(string, sizeof(string), "%s Says[Russian] %s", sendername, text);
  177. ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
  178. return 1;
  179. }
  180. else if(accent[playerid] == 2)
  181. {
  182. new string[256];
  183. new sendername[MAX_PLAYER_NAME];
  184. GetPlayerName(playerid, sendername, sizeof(sendername));
  185. format(string, sizeof(string), "%s Says[Italian] %s", sendername, text);
  186. ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
  187. return 1;
  188. }
  189. else if(accent[playerid] == 3)
  190. {
  191. new string[256];
  192. new sendername[MAX_PLAYER_NAME];
  193. GetPlayerName(playerid, sendername, sizeof(sendername));
  194. format(string, sizeof(string), "%s Says[Gangster] %s", sendername, text);
  195. ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
  196. return 1;
  197. }
  198. else if(accent[playerid] == 4)
  199. {
  200. new string[256];
  201. new sendername[MAX_PLAYER_NAME];
  202. GetPlayerName(playerid, sendername, sizeof(sendername));
  203. format(string, sizeof(string), "%s Says[French] %s", sendername, text);
  204. ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
  205. return 1;
  206. }
  207. else if(accent[playerid] == 5)
  208. {
  209. new string[256];
  210. new sendername[MAX_PLAYER_NAME];
  211. GetPlayerName(playerid, sendername, sizeof(sendername));
  212. format(string, sizeof(string), "%s Says[Japanese] %s", sendername, text);
  213. ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
  214. return 1;
  215. }
  216. else if(accent[playerid] == 6)
  217. {
  218. new string[256];
  219. new sendername[MAX_PLAYER_NAME];
  220. GetPlayerName(playerid, sendername, sizeof(sendername));
  221. format(string, sizeof(string), "%s Says[Korean] %s", sendername, text);
  222. ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
  223. return 1;
  224. }
  225. else if(accent[playerid] == 7)
  226. {
  227. new string[256];
  228. new sendername[MAX_PLAYER_NAME];
  229. GetPlayerName(playerid, sendername, sizeof(sendername));
  230. format(string, sizeof(string), "%s Says[Chinese] %s", sendername, text);
  231. ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
  232. return 1;
  233. }
  234. }
  235. return 1;
  236. }
Advertisement
Add Comment
Please, Sign In to add comment