new SmugglerJob[256];
AddStaticVehicle(482,1772.6602,-2048.9277,13.6440,270.5698,3,0); // Smugglerjob 1 AddStaticVehicle(482,1773.2407,-2042.7849,13.6227,269.7848,3,4); // Smugglerjob 2 AddStaticVehicle(482,1772.5969,-2037.0247,13.6003,270.9971,3,6); // Smugglerjob 3 AddStaticVehicle(482,1772.4786,-2031.4073,13.5899,270.2319,3,1); // Smugglerjob 4
public OnPlayerCommandText(playerid, cmdtext[])
if (strcmp("/cratesmuggle", cmdtext, true, 0) == 0)
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 482)
SmugglerJob[playerid] = 1;
SetPlayerCheckpoint(playerid,1751.0360,-2058.4458,13.5892,10);
SendClientMessage(playerid, 0xFFFF00AA, "* Get the goods from the garage and deliver 'em lazy boy!");
return 1;
SendClientMessage(playerid, COLOR_RED,"You have to be in a smuggling vehicle to do this!");
public OnPlayerCommandText(playerid, cmdtext[]) { //smuggler if (strcmp("/cratesmuggle", cmdtext, true, 10) == 0) { if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 482) { SmugglerJob[playerid] = 1; SetPlayerCheckpoint(playerid,1751.0360,-2058.4458,13.5892,10); SendClientMessage(playerid, 0xFFFF00AA, "* Get the goods from the garage and deliver 'em lazy boy!"); return 1; } SendClientMessage(playerid, 0xFFFF00AA,"You have to be in a smuggling vehicle to do this!"); }
public OnPlayerEnterCheckpoint(playerid)
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 482) {
if(SmugglerJob[playerid] == 1){ SmugglerJob[playerid] = 2;
SetPlayerCheckpoint(playerid,1751.0360,-2058.4458,13.5892,10);
SendClientMessage(playerid, 0xFFFF00AA, "*Crazy ED: Move your lazzy ass to bayside and deliver those crates!");
return 1;
if(SmugglerJob[playerid] == 2){ SmugglerJob[playerid] = 3; SetPlayerCheckpoint(playerid,-2431.2441,2312.9509,4.9844,10); return 1; }
if(SmugglerJob[playerid] == 3){ SmugglerJob[playerid] = 0; SendClientMessage(playerid, 0xFFFF00AA, "*Crazy ED: Fine... Here you go! Come back soon when you get more crates! Now piss off!"); SendClientMessage(playerid, 0xFFFF00AA, "Gradulations. You have completed your Smuggling route. You have received 500$"); GivePlayerMoney(playerid, 500); DisablePlayerCheckpoint(playerid); return 1;
public OnPlayerEnterCheckpoint(playerid) { if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 482) { if(SmugglerJob[playerid] == 1){ SmugglerJob[playerid] = 2; SetPlayerCheckpoint(playerid,1751.0360,-2058.4458,13.5892,10); SendClientMessage(playerid, 0xFFFF00AA, "*Crazy ED: Move your lazzy ass to bayside and deliver those crates!"); return 1; } if(SmugglerJob[playerid] == 2){ SmugglerJob[playerid] = 3; SetPlayerCheckpoint(playerid,-2431.2441,2312.9509,4.9844,10); return 1; } if(SmugglerJob[playerid] == 3){ SmugglerJob[playerid] = 0; SendClientMessage(playerid, 0xFFFF00AA, "*Crazy ED: Fine... Here you go! Come back soon when you get more crates! Now piss off!"); SendClientMessage(playerid, 0xFFFF00AA, "Gradulations. You have completed your Smuggling route. You have received 500$"); GivePlayerMoney(playerid, 500); DisablePlayerCheckpoint(playerid); return 1; } }
public OnPlayerExitVehicle(playerid, vehicleid)
if(SmugglerJob[playerid] > 0)
SmugglerJob[playerid] = 0;
DisablePlayerCheckpoint(playerid);
public OnPlayerExitVehicle(playerid, vehicleid) { if(SmugglerJob[playerid] > 0) { SmugglerJob[playerid] = 0; DisablePlayerCheckpoint(playerid); } }
Not that bad, although you could have explained it a bit better and use better methods.
Such as a Job variable, so that you can set the value to the jobid to make sure that you don't have to continuously make new variables for each job. |