Advertisement
SeC

Walkie Tokie By Cirs Carandente AkA S&C

SeC
Aug 22nd, 2011
545
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.57 KB | None | 0 0
  1. #include <a_samp>
  2. #include <zcmd>
  3. #include <sscanf>
  4.  
  5. #define COLOREWT 0x00E2F6AA
  6. #define VERDE 0x00F600AA
  7. #define ROSSO 0xF60000AA
  8.  
  9. new bool:WTState[MAX_PLAYERS] = false; // Se è uguale a false significa che è spento, invece se è true, è acceso.
  10. new CanaleWT[MAX_PLAYERS];//Canale WT
  11.  
  12.  
  13. public OnFilterScriptInit()
  14. {
  15. print("\n--------------------------------------");
  16. print(" Blank Filterscript by your name here");
  17. print("--------------------------------------\n");
  18. return 1;
  19. }
  20.  
  21. public OnFilterScriptExit()
  22. {
  23. return 1;
  24. }
  25.  
  26. public OnPlayerConnect(playerid)
  27. {
  28. WTState[playerid] = false;
  29. CanaleWT[playerid] = 0;
  30. return 1;
  31. }
  32.  
  33.  
  34. public OnPlayerCommandText(playerid, cmdtext[])
  35. {
  36. if (strcmp("/mycommand", cmdtext, true, 10) == 0)
  37. {
  38. // Do something here
  39. return 1;
  40. }
  41. return 0;
  42. }
  43. CMD:accendiwt(playerid, params[])
  44. {
  45. if(WTState[playerid] == false)
  46. {
  47. WTState[playerid] = true;
  48. CanaleWT[playerid] = 0;
  49. SendClientMessage(playerid, VERDE, "Hai acceso il tuo WT, usa /i per parlare.");
  50. }
  51. else if(WTState[playerid] == true)
  52. {
  53. WTState[playerid] = false;
  54. SendClientMessage(playerid, VERDE, "Hai spento il tuo WT, usa /accendiwt per accenderlo.");
  55. }
  56. return 1;
  57. }
  58.  
  59. CMD:i(playerid, params[])
  60. {
  61. new MWT[128], stringa[128], Nome[24];
  62. if(sscanf(params, "s", MWT))return SendClientMessage(playerid, ROSSO, "/i [Messaggio]");
  63. if(WTState[playerid] == false)return SendClientMessage(playerid, ROSSO, "Il tuo WT è spento");
  64. for(new i = 0; i<MAX_PLAYERS; i++)
  65. {
  66. if(CanaleWT[i] == CanaleWT[playerid] && WTState[i] == true)
  67. {
  68. GetPlayerName(playerid, Nome, sizeof(Nome));
  69. format(stringa, sizeof(stringa), "[WT] %s dice: %s", Nome, MWT);
  70. SendClientMessage(i, COLOREWT, stringa);
  71. }
  72. }
  73. return 1;
  74. }
  75.  
  76. CMD:canalewt(playerid, params[])
  77. {
  78. new Canale, stringa[128], Nome[24];
  79. if(sscanf(params, "d", Canale))return SendClientMessage(playerid, ROSSO, "/canalewt [IdCanale]");
  80. if(Canale == CanaleWT[playerid])return SendClientMessage(playerid, ROSSO, "Sei già in questo canale");
  81. if(WTState[playerid] == false)return SendClientMessage(playerid, ROSSO, "Il tuo WT è spento");
  82. CanaleWT[playerid] = Canale;
  83. format(stringa, sizeof(stringa), "Hai cambiato il canale WT in %d", Canale);
  84. SendClientMessage(playerid, VERDE, stringa);
  85. for(new i = 0; i<MAX_PLAYERS; i++)
  86. {
  87. if(CanaleWT[i] == Canale)
  88. {
  89. GetPlayerName(playerid, Nome, sizeof(Nome));
  90. format(stringa, sizeof(stringa), "%s è entrato nel canale", Nome);
  91. SendClientMessage(i, VERDE, stringa);
  92. }
  93. }
  94. return 1;
  95. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement