Advertisement
Guest User

Untitled

a guest
Dec 22nd, 2014
340
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.92 KB | None | 0 0
  1. ///////////////////////////////////////
  2. ///////////Events System//////////////
  3. //////////Made By Ahmed_Nezoo////////
  4. ////////////////////////////////////
  5. #define FILTERSCRIPT
  6.  
  7. #include <a_samp>
  8. #include <zcmd>
  9. #include <sscanf2>
  10.  
  11. #if defined FILTERSCRIPT
  12. #endif
  13. ////////////////
  14. #define COLOR_RED 0xFF0000AA
  15. #define COLOR_GREEN 0x00FF00FF
  16. ////////////////
  17. new MAX_EVENTS = 1;
  18. new Events = 0;
  19.  
  20. ///////////////
  21. public OnFilterScriptInit()
  22. {
  23. print("\n--------------------------------------");
  24. print(" Event System By Ahmed_Nezoo");
  25. print("--------------------------------------\n");
  26. return 1;
  27. }
  28.  
  29. public OnFilterScriptExit()
  30. {
  31. return 1;
  32. }
  33.  
  34. //Event System
  35. CMD:crevent(playerid, params[])
  36. {
  37. if(MAX_EVENTS > Events)
  38. {
  39. Events++;
  40. SetPlayerVirtualWorld(playerid, 1);
  41. SendClientMessage(playerid, COLOR_GREEN, "An event created !");
  42. }
  43. else
  44. {
  45. SendClientMessage(playerid, COLOR_RED, "Sorry there is an event right now !");
  46. SetPlayerVirtualWorld(playerid, 0);
  47. }
  48. return 1;
  49. }
  50.  
  51. CMD:finish(playerid, params[])
  52. {
  53. if(Events > 0)
  54. {
  55. Events -= 1;
  56. SendClientMessage(playerid, COLOR_GREEN, "Event finsihed !");
  57. SetPlayerVirtualWorld(playerid, 0);
  58. }
  59. else
  60. {
  61. SendClientMessage(playerid, COLOR_RED, "There isn't any running event !");
  62. }
  63. return 1;
  64. }
  65.  
  66. CMD:join(playerid, params[])
  67. {
  68. new world = GetPlayerVirtualWorld(playerid);
  69. if(Events == 0)
  70. {
  71. SendClientMessage(playerid, COLOR_RED, "There isn't any hosted event right now !");
  72. }
  73. else if(world == 1)
  74. {
  75. SendClientMessage(playerid, COLOR_RED, "You are already in an event !");
  76. }
  77. else
  78. {
  79. SetPlayerVirtualWorld(playerid, 1);
  80. SendClientMessage(playerid, COLOR_GREEN, "You have joined an event !");
  81. }
  82. return 1;
  83. }
  84.  
  85. CMD:leave(playerid, params[])
  86. {
  87. new world = GetPlayerVirtualWorld(playerid);
  88.  
  89. if(world != 0)
  90. {
  91. SetPlayerVirtualWorld(playerid, 0);
  92. }
  93. else
  94. {
  95. SendClientMessage(playerid, COLOR_RED, "You didn't join any event !");
  96. }
  97. return 1;
  98. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement