Guest User

Untitled

a guest
Feb 4th, 2011
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. forward SendRadioMessage(member, COLOR, string[]);
  2.  
  3.  
  4.  
  5.  
  6.  
  7. new cmd[256];
  8. new idx;
  9. new string[256];
  10. if(strcmp(cmd, "/radio", true) == 0 || strcmp(cmd, "/r", true) == 0)
  11. {
  12. if(IsPlayerConnected(playerid))
  13. {
  14. GetPlayerName(playerid, sendername, sizeof(sendername));
  15. new length = strlen(cmdtext);
  16. while ((idx < length) && (cmdtext[idx] <= ' '))
  17. {
  18. idx++;
  19. }
  20. new offset = idx;
  21. new result[64];
  22. while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  23. {
  24. result[idx - offset] = cmdtext[idx];
  25. idx++;
  26. }
  27. result[idx - offset] = EOS;
  28. if(!strlen(result))
  29. {
  30. SendClientMessage(playerid, VERDE, "USO: (/r)adio [radio chat]");
  31. return 1;
  32. }
  33. if(Profissao[playerid] == TAXISTA)
  34. {
  35. if(Profissao[playerid] == TAXISTA) { format(string, sizeof(string), "** Taxista %s: %s, . **", sendername, result); }
  36.  
  37. {
  38. format(string, sizeof(string), "** Taxista %s: %s, . **", sendername, result);
  39. }
  40. SendRadioMessage(1, VERDE, string);
  41. printf("%s", string);
  42. return 1;
  43. }
  44. else
  45. {
  46. SendClientMessage(playerid, VERDE, " Você não pode usar o rádio !");
  47. return 1;
  48. }
  49. }
  50. return 1;
  51. }
  52.  
  53.  
  54.  
  55.  
  56. public SendRadioMessage(member, COLOR, string[])
  57. {
  58. for(new i = 0; i < MAX_PLAYERS; i++)
  59. {
  60. if(IsPlayerConnected(i))
  61. {
  62. if(Profissao[i] == TAXISTA)
  63. {
  64. SendClientMessage(i, VERDE, string);
  65. }
  66. }
  67. }
  68. }
Advertisement
Add Comment
Please, Sign In to add comment