23.07.2015, 20:16
How do I change the order of CMD in dcmd_ ?
for example
Код:
CMD:startwork(playerid, params[]) { if(MissionStatus[playerid] == 0) { SCM(playerid, -1, "hello"); if(gTeam[playerid] == TEAM_TRUCKER) { new vID = GetPlayerVehicleID(playerid); if(GetVehicleModel(vID)== 403 || GetVehicleModel(vID)== 515 || GetVehicleModel(vID) == 514) { if(IsTrailerAttachedToVehicle(vID)) { MissionStatus[playerid] = 1; new MisRand = random(sizeof(MisLocations)); new LoadText[128], Float:x, Float:y, Float:z; new string[128]; x = MisLocations[MisRand][LoadX]; y = MisLocations[MisRand][LoadY]; z = MisLocations[MisRand][LoadZ]; unx[playerid] = MisLocations[MisRand][UnloadX]; uny[playerid] = MisLocations[MisRand][UnloadY]; unz[playerid] = MisLocations[MisRand][UnloadZ]; iPay[playerid] = MisLocations[MisRand][Pay]; SetPlayerCheckpoint(playerid, x, y, z, 7); format(string, sizeof(string), "~r~Currently Your Doing ~p~Trucker Job~w~ Go to the Red Checkpoint."); TextDrawSetString(WorkText, string); TextDrawShowForPlayer(playerid, WorkText); format(LoadText, 128, "%s",MisLocations[MisRand][LoadName]); SCM(playerid, COLOR_GREEN, "Mission:"); SCM(playerid, 0xFFFFFFFF, LoadText); SCM(playerid, COLOR_GREEN, "You are now doing the Trucker job. Go to the Red Checkpoint"); } else { SCM(playerid, COLOR_RED, "You need a trailer!"); } } else { SCM(playerid, COLOR_RED, "You must be in a Truck to perform this!"); } } else if(gTeam[playerid] == TEAM_BUSDRIVER) { SCM(playerid, -1, "bus"); new vID = GetPlayerVehicleID(playerid); if(GetVehicleModel(vID)== 437 || GetVehicleModel(vID)== 431) { SCM(playerid, -1, "bus"); MissionStatus[playerid] = 1; SCM(playerid, -1, "bus"); new BusRand = random(sizeof(BusLocations)); new LoadText[128], Float:x, Float:y, Float:z; new string[128]; SCM(playerid, -1, "bus"); x = BusLocations[BusRand][LoadX]; y = BusLocations[BusRand][LoadY]; z = BusLocations[BusRand][LoadZ]; unx[playerid] = BusLocations[BusRand][UnloadX]; uny[playerid] = BusLocations[BusRand][UnloadY]; unz[playerid] = BusLocations[BusRand][UnloadZ]; iPay[playerid] = BusLocations[BusRand][Pay]; SCM(playerid, -1, "bus"); format(string, sizeof(string), "~r~Currently Your Doing ~p~Bus Driver Job~w~ Go to the Red Checkpoint."); TextDrawSetString(WorkText, string); TextDrawShowForPlayer(playerid, WorkText); SetPlayerCheckpoint(playerid, x, y, z, 7); format(LoadText, 128, "%s",BusLocations[BusRand][LoadName]); SCM(playerid, COLOR_GREEN, "Mission:"); SCM(playerid, 0xFFFFFFFF, LoadText); SCM(playerid, COLOR_GREEN, "You are now doing the Bus Driver job. Go to the Red Checkpoint"); SCM(playerid, -1, "bus"); } else { SCM(playerid, COLOR_RED, "You must be in a Bus to perform this!"); } } else if(gTeam[playerid] == TEAM_TAXIDRIVER) { new vID = GetPlayerVehicleID(playerid); if(GetVehicleModel(vID)== 420) { MissionStatus[playerid] = 1; new string[128]; new TaxiRand = random(sizeof(TaxiLocations)); new LoadText[128], Float:x, Float:y, Float:z; x = TaxiLocations[TaxiRand][LoadX]; y = TaxiLocations[TaxiRand][LoadY]; z = TaxiLocations[TaxiRand][LoadZ]; unx[playerid] = TaxiLocations[TaxiRand][UnloadX]; uny[playerid] = TaxiLocations[TaxiRand][UnloadY]; unz[playerid] = TaxiLocations[TaxiRand][UnloadZ]; iPay[playerid] = TaxiLocations[TaxiRand][Pay]; SetPlayerCheckpoint(playerid, x, y, z, 7); format(string, 128, "~r~Currently Your Doing ~p~Taxi Driver Job~w~ Go to the Red Checkpoint."); TextDrawSetString(WorkText, string); TextDrawShowForPlayer(playerid, WorkText); format(LoadText, 128, "%s",TaxiLocations[TaxiRand][LoadName]); SCM(playerid, COLOR_GREEN, "Mission:"); SCM(playerid, 0xFFFFFFFF, LoadText); SCM(playerid, COLOR_GREEN, "You are now doing the Taxi job. Go to the Red Checkpoint"); } else { SCM(playerid, COLOR_RED, "You must be in a Taxi to perform this!"); } } else if(gTeam[playerid] == TEAM_PILOT) { new vID = GetPlayerVehicleID(playerid); if(GetVehicleModel(vID)== 519 || GetVehicleModel(vID)== 553) { MissionStatus[playerid] = 1; new PilotRand = random(sizeof(PilotLocations)); new LoadText[128], Float:x, Float:y, Float:z; new string[128]; x = PilotLocations[PilotRand][LoadX]; y = PilotLocations[PilotRand][LoadY]; z = PilotLocations[PilotRand][LoadZ]; unx[playerid] = PilotLocations[PilotRand][UnloadX]; uny[playerid] = PilotLocations[PilotRand][UnloadY]; unz[playerid] = PilotLocations[PilotRand][UnloadZ]; iPay[playerid] = PilotLocations[PilotRand][Pay]; SetPlayerCheckpoint(playerid, x, y, z, 7); format(string, 128, "~r~Currently Your Doing ~p~Pilot Job~w~ Go to the Red Checkpoint."); format(LoadText, 128, "%s",PilotLocations[PilotRand][LoadName]); SCM(playerid, COLOR_GREEN, "Mission:"); SCM(playerid, 0xFFFFFFFF, LoadText); SCM(playerid, COLOR_GREEN, "You are now doing the Pilot Job. Go to the Red Checkpoint"); TextDrawSetString(WorkText, string); TextDrawShowForPlayer(playerid, WorkText); } else { SCM(playerid, COLOR_RED, "You must be in a Shamal Or Nevada to perform this!"); } } else if(gTeam[playerid] == TEAM_BOATDRIVER) { new vID = GetPlayerVehicleID(playerid); new string[128]; if(GetVehicleModel(vID) == 473 || GetVehicleModel(vID) == 493) { MissionStatus[playerid] = 1; new SkipRand = random(sizeof(BoatLocations)); new LoadText[128], Float:x, Float:y, Float:z; x = BoatLocations[SkipRand][LoadX]; y = BoatLocations[SkipRand][LoadY]; z = BoatLocations[SkipRand][LoadZ]; unx[playerid] = BoatLocations[SkipRand][UnloadX]; uny[playerid] = BoatLocations[SkipRand][UnloadY]; unz[playerid] = BoatLocations[SkipRand][UnloadZ]; iPay[playerid] = BoatLocations[SkipRand][Pay]; SetPlayerCheckpoint(playerid, x, y, z, 7); format(LoadText, 128, "%s", BoatLocations[SkipRand][LoadName]); format(string, 128, "~r~Currently Your Doing ~p~Skipper Job~w~ Go to the Red Checkpoint."); TextDrawSetString(WorkText, string); TextDrawShowForPlayer(playerid, WorkText); SCM(playerid, COLOR_GREEN, "Mission:"); SCM(playerid, 0xFFFFFFFF, LoadText); SCM(playerid, COLOR_GREEN, "You are now doing the Skipper Job. Go to the Red Checkpoint"); } else { SCM(playerid, COLOR_RED, "You must be in a Dinghy Or Jetmax to perform this"); } } } else { SCM(playerid, COLOR_RED, "You are already on a mission. Use /stopwork if you want to quit the mission"); } return 1; }
Код:
CMD:stopwork(playerid, params[]) { if(MissionStatus[playerid] == 1) { TextDrawHideForPlayer(playerid, WorkText); DisablePlayerCheckpoint(playerid); SCM(playerid, COLOR_RED, "You chose to cancel the mission and got fined $1000"); GivePlayerMoney(playerid, -1000); MissionStatus[playerid] = 0; } else { SCM(playerid, COLOR_RED, "You are not doing any job. Type /work to start a job"); } return 1; }
for example
Код:
dcmd_spawn(playerid,params[]) { if(AccInfo[playerid][Level] >= 2) { if(!strlen(params)) return SendClientMessage(playerid, LIGHTBLUE2, "Usage: /spawn [PlayerID]") && SendClientMessage(playerid, orange, "Function: Will Spawn a specified player"); new player1 = strval(params); new string[128]; if(AccInfo[player1][Level] == ServerInfo[MaxAdminLevel] && AccInfo[playerid][Level] != ServerInfo[MaxAdminLevel]) return SendClientMessage(playerid,red,"ERROR: You cannot use this command on this admin"); if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID) { SendCommandToAdmins(playerid,"Spawn"); format(string, sizeof(string), "|- You have Spawned \"%s\" -|", pName(player1)); SendClientMessage(playerid,BlueMsg,string); if(player1 != playerid) { format(string,sizeof(string),"|- Administrator \"%s\" has Spawned you -|", pName(playerid)); SendClientMessage(player1,blue,string); } SetPlayerPos(player1, 0.0, 0.0, 0.0); return SpawnPlayer(player1); } else return ErrorMessages(playerid, 2); } else return ErrorMessages(playerid, 1); }