CMD:derby(playerid,params[]) { if(InSideHouse[playerid]) return SendClientMessage(playerid,yellow,"* Sorry, you must exit the house (/exith) to use the commands."); if(CagedPlayer[playerid]) return SendClientMessage(playerid,yellow,"* Sorry, you cannot use this command while caged."); if(ToiletedPlayer[playerid]) return SendClientMessage(playerid,yellow,"* Sorry, you cannot use any commands while in a toilet."); if(IsAFK[playerid]) return SendClientMessage(playerid,red,"Sorry, you cannot use this command while in AFK mode"); if(InRace[playerid]) return SendClientMessage(playerid,yellow,"* Sorry, you cannot use this command while racing."); 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); } 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); } if(PlayerInfo[playerid][Jailed] == 1) return SendClientMessage(playerid,COLOR_BRIGHTRED,"You cannot escape your punishment!"); if (GetPlayerState(playerid) == 2) { Minigame[playerid] = 1; new Random = random(sizeof(RaddomSpawns)); SetPlayerPos(playerid, RaddomSpawns[Random][0], RaddomSpawns[Random][1], RaddomSpawns[Random][2]); SetPlayerFacingAngle(playerid, RaddomSpawns[Random][3]); SetPlayerInterior(playerid, 0); new Float:X,Float:Y,Float:Z,Float:A; GetPlayerPos(playerid,X,Y,Z); GetPlayerFacingAngle(playerid,A); dCar = CreateVehicle(451,X,Y,Z,A,1,1); PutPlayerInVehicle(playerid,dCar,0); GameTextForPlayer(playerid,"~g~~h~Derby!",5000,4); } else { Minigame[playerid] = 1; PutPlayerInVehicle(playerid, 451, 0); new Random = random(sizeof(RaddomSpawns)); SetPlayerPos(playerid, RaddomSpawns[Random][0], RaddomSpawns[Random][1], RaddomSpawns[Random][2]); SetPlayerFacingAngle(playerid, RaddomSpawns[Random][3]); SetPlayerInterior(playerid, 0); new Float:X,Float:Y,Float:Z,Float:A; GetPlayerPos(playerid,X,Y,Z); GetPlayerFacingAngle(playerid,A); dCar = CreateVehicle(451,X,Y,Z,A,1,1); PutPlayerInVehicle(playerid,dCar,0); GameTextForPlayer(playerid,"~g~~h~Derby!",5000,4); } return 1;} |