Martex

EVENT

Jul 18th, 2016
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.20 KB | None | 0 0
  1. CMD:startcrydm(playerid,params[])
  2. {
  3. if(pInfo[playerid][pLevel] >= 6)
  4. {
  5. new string[134],irc[134];
  6. if(EventCountDown == true)
  7. {
  8. SendClientMessage(playerid,red,"The Event CountDown is Already In Progress");
  9. }
  10. if(EventRun == true)
  11. {
  12. SendClientMessage(playerid,red,"The Event Is Already Running !");
  13. }
  14. if(EventCountDown == false)
  15. {
  16. format(string,sizeof(string),"Admin %s (ID: %d) Has Loaded The Event CryDM",GetName(playerid),playerid);
  17. SendClientMessageToAll(0xEBFF00FF,string);
  18. format(irc, sizeof(irc), "02 03*** 6,11 Admin %s (ID: %d) Has Loaded The Event CryDM.", GetName(playerid),playerid);
  19. IRC_GroupSay(groupID, IRC_CHANNEL, irc);
  20. TDEditor_TD[0] = TextDrawCreate(385.199920, 2.159988, "TYPE_/EVENT_TO_JOIN_THE_CRYDM~n~STARTING_IN_60_SECONDS");
  21. TextDrawLetterSize(TDEditor_TD[0], 0.385599, 1.368532);
  22. TextDrawTextSize(TDEditor_TD[0], 639.000000, 0.000000);
  23. TextDrawAlignment(TDEditor_TD[0], 1);
  24. TextDrawColor(TDEditor_TD[0], -55297);
  25. TextDrawUseBox(TDEditor_TD[0], 1);
  26. TextDrawBoxColor(TDEditor_TD[0], -16711681);
  27. TextDrawSetShadow(TDEditor_TD[0], 2);
  28. TextDrawSetOutline(TDEditor_TD[0], 2);
  29. TextDrawBackgroundColor(TDEditor_TD[0], 255);
  30. TextDrawFont(TDEditor_TD[0], 1);
  31. TextDrawSetProportional(TDEditor_TD[0], 1);
  32. TextDrawSetShadow(TDEditor_TD[0], 2);
  33. EventCountDown = true;
  34. EventStartTimer = SetTimer("textdraw", 1000, true);
  35. }
  36. return 1;
  37. }
  38. else return ShowMessage(playerid,red,1);
  39. }
  40. forward textdraw();
  41. public textdraw()
  42. {
  43. // You decrease the start time here
  44. EventStartTime--;
  45.  
  46. // Check if we need to start the event
  47. if(EventStartTime == 0)
  48. {
  49. /*StartYourEvent;*/
  50. KillTimer(EventStartTimer );
  51. TextDrawHideForAll(TDEditor_TD[0]);
  52. EventStartTime = 50;
  53. EventCountDown = false;
  54. EventRun = true;
  55. }
  56.  
  57. else
  58. {
  59. new string[1243];
  60. // Edit the text draw with the correct time
  61. format(string, sizeof(string), "TYPE /EVENT TO JOIN THE CRYDM STARTING IN %d SECONDS", EventStartTime);
  62. TextDrawSetString(TDEditor_TD[0], string);
  63. TextDrawShowForAll(TDEditor_TD[0]);
  64. }
  65. }
  66. CMD:event(playerid,params[])
  67. {
  68. if(EventRun == false)
  69. {
  70. new irc[123];
  71. SendClientMessage(playerid,0xF5FF00FF,"You Have joined The Event");
  72. format(irc, sizeof(irc), "02 03*** 6,11 %s (ID: %d) has joined the event.", GetName(playerid),playerid);
  73. IRC_GroupSay(groupID, IRC_CHANNEL, irc);
  74. InEvent[playerid] = 1;
  75. SetPlayerPos(playerid,214.4277,1864.1901,13.1406);
  76. SendClientMessage(playerid,0xF5FF00FF,"Welcome To CryDM Event If you want to leave type /le");
  77. }
  78. if(EventRun == true)
  79. {
  80. SendClientMessage(playerid,red,"Sorry, Event Is Already Running");
  81. }
  82. return 1;
  83. }
  84. CMD:le(playerid,params[])
  85. {
  86. if(EventRun == false)
  87. {
  88. SendClientMessage(playerid,red,"Sorry, There is no any event running right now or There Is An Event Running.");
  89. }
  90. if(InEvent[playerid] == 0)
  91. {
  92. SendClientMessage(playerid,red,"Sorry, You Must be in Event to use this command.");
  93. }
  94. if(InEvent[playerid] == 1 && EventRun == true)
  95. {
  96. SendClientMessage(playerid,red,"You Left the Event");
  97. SetPlayerHealth(playerid,0);
  98. InEvent[playerid] = 0;
  99. }
  100. return 1;
  101. }
Advertisement
Add Comment
Please, Sign In to add comment