Advertisement
LVPYassine

Untitled

Jan 13th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.15 KB | None | 0 0
  1. CMD:__buildrace(playerid, params[])
  2. {
  3. if(PlayerInfo[playerid][Level] == 0) return SendClientMessage(playerid, RED, "ERROR: You are not an administrator!");
  4. if(BuildRace != 0) return SendClientMessage(playerid, RED, "ERROR: There's already someone building a race!");
  5. if(RaceBusy == 0x01) return SendClientMessage(playerid, RED, "Wait first till race ends!");
  6. if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, RED, "Please leave your vehicle first!");
  7. BuildRace = playerid+1;
  8. ShowDialog(playerid, 599);
  9. return 1;
  10. }
  11. CMD:__startrace(playerid, params[])
  12. {
  13. if(PlayerInfo[playerid][Level] == 0) return SendClientMessage(playerid, RED, "ERROR: You are not an administrator!");
  14. if(AutomaticRace == true) return SendClientMessage(playerid, RED, "ERROR: Not possible. Automatic race is enabled!");
  15. if(BuildRace != 0) return SendClientMessage(playerid, RED, "There's someone building a race!");
  16. if(RaceBusy == 0x01 || RaceStarted == 1) return SendClientMessage(playerid, RED, "ERROR: There's a race currently. Wait first till race ends!");
  17. if(isnull(params)) return SendClientMessage(playerid, RED, "USEAGE: /startrace [racename]");
  18. LoadRace(playerid, params);
  19. return 1;
  20. }
  21. CMD:__stoprace(playerid, params[])
  22. {
  23. if(PlayerInfo[playerid][Level] == 0) return SendClientMessage(playerid, RED, "ERROR: You are not an administrator!");
  24. if(RaceBusy == 0x00 || RaceStarted == 0) return SendClientMessage(playerid, RED, "ERROR: There's no race to stop!");
  25. SendClientMessageToAll(COLOR_ORANGE, "An administrator has stopped the current race.");
  26. StopRace();
  27. return 1;
  28. }
  29. CMD:join(playerid, params[])
  30. {
  31. if(InSideHouse[playerid]) return SendClientMessage(playerid,yellow,"* Sorry, you must exit the house (/exith) to use the commands.");
  32. if(CagedPlayer[playerid]) return SendClientMessage(playerid,yellow,"* Sorry, you cannot use this command while caged.");
  33. if(ToiletedPlayer[playerid]) return SendClientMessage(playerid,yellow,"* Sorry, you cannot use any commands while in a toilet.");
  34. if(IsAFK[playerid]) return SendClientMessage(playerid,red,"Sorry, you cannot use this command while in AFK mode");
  35. if(Minigame[playerid]) { SendClientMessage(playerid,yellow,"* Sorry, you must type /exitm to exit from this Mini Game."); return GameTextForPlayer(playerid, " ~w~ type ~r~~h~/exitm ~w~to exit",3000,3); }
  36. if(LastShotTime[playerid] != -1) {
  37. if(GetTickCount() < LastShotTime[playerid]) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You cannot use this command right after you've shot!");
  38. }
  39. else if(LastDmgTime[playerid] != -1) {
  40. if(GetTickCount() < LastDmgTime[playerid]) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You cannot use this command right now as it would result in a death evade!");
  41. }
  42. if(Specing[playerid]) { SendClientMessage(playerid,yellow,"* Sorry, you are not supposed to use this command at the moment."); return GameTextForPlayer(playerid, " ~y~ type /specoff to exit",3000,3); }
  43. if(PlayerInfo[playerid][Jailed] == 1) return SendClientMessage(playerid,COLOR_BRIGHTRED,"You cannot escape your punishment!");
  44. if(RaceStarted == 1) return SendClientMessage(playerid, RED, "Race already started! Wait first till race ends!");
  45. if(RaceBusy == 0x00) return SendClientMessage(playerid, RED, "ERROR: There's no race to join!");
  46. if(Joined[playerid] == true) return SendClientMessage(playerid, RED, "ERROR: You already joined a race!");
  47. SendClientMessage(playerid,COLOR_YELLOW,"**Your vehicle speed boost, instant stop and jump up are disabled.");
  48. SendClientMessage(playerid,COLOR_YELLOW,"* Once the countdown starts, your weapons will be disarmed.");
  49. SendClientMessage(playerid,0xDC143CAA,"WARNING: Do not annoy racers and do not try to cheat while racing or you will be punished by the server admins!");
  50. if(IsPlayerInAnyVehicle(playerid))
  51. {
  52. SetTimerEx("SetupRaceForPlayer", 2500, 0, "e", playerid);
  53. RemovePlayerFromVehicle(playerid);
  54. Joined[playerid] = true;
  55. InRace[playerid] = 1;
  56. }
  57. else {
  58. Joined[playerid] = true;
  59. InRace[playerid] = 1;
  60. SetupRaceForPlayer(playerid);}
  61. return 1;
  62. }
  63. CMD:__startautorace(playerid, params[])
  64. {
  65. if(PlayerInfo[playerid][Level] == 0) return SendClientMessage(playerid, RED, "ERROR: You are not an administrator!");
  66. if(RaceBusy == 0x01 || RaceStarted == 1) return SendClientMessage(playerid, RED, "There's a race currently. Wait first till race ends!");
  67. if(AutomaticRace == true) return SendClientMessage(playerid, RED, "It's already enabled!");
  68. LoadRaceNames();
  69. LoadAutoRace(RaceNames[random(TotalRaces)]);
  70. AutomaticRace = true;
  71. SendClientMessage(playerid, GREEN, "* You stared auto race. The filterscript will start a random race everytime the previous race is over!");
  72. return 1;
  73. }
  74. CMD:__stopautorace(playerid, params[])
  75. {
  76. if(PlayerInfo[playerid][Level] == 0) return SendClientMessage(playerid, RED, "ERROR: You are not an administrator!");
  77. if(AutomaticRace == false) return SendClientMessage(playerid, RED, "It's already disabled!");
  78. AutomaticRace = false;
  79. return 1;
  80. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement