02.02.2010, 01:56
Create a variable that determines how much drugs is on each vehicle
Then a command or checkpoint that can only be used/shown when the vehicle is at it's dropoff point.
So let's say you buy drugs with the Walton truck from a druglab in LS, that would be a command/checkpoint in LS that determines that they're using the correct vehicle type
Then that person would drive their truck to the airport where a plane has to be in reach of the player's truck or vice-versa
You would then do the same thing but different vehicle models for the dodo to yosemite truck
pawn Код:
new vDrugStash[MAX_VEHICLES];
So let's say you buy drugs with the Walton truck from a druglab in LS, that would be a command/checkpoint in LS that determines that they're using the correct vehicle type
pawn Код:
new vehmodel=GetVehicleModel(GetPlayerVehicleID(playerid));
if(vehmodel==478)//478=walton
{
//buy drugs code
GivePlayerMoney(playerid,-500);
vDrugStash[GetPlayerVehicleID(playerid)]+=10;
}
pawn Код:
new vehmodel=GetVehicleModel(GetPlayerVehicleID(playerid));
if(vehmodel==478)
{
for(new vehm;vehm<MAX_VEHICLES;vehm++)
{
if(GetVehicleModel(vehm)==593)//593=dodo
{
new Float:x,Float:y,Float:z;
GetVehiclePos(vehm,x,y,z);
if(IsPlayerInRangeOfPoint(playerid,x,y,z))
{
//transfer drugs
vDrugStash[vehm]+=vDrugStash[GetPlayerVehicleID(playerid)];
vDrugStash[GetPlayerVehicleID(playerid)]=0;
return 1; //Loop has to end here
}
}
}
//If the code gets here the player wasn't near a DODO plane
}else{
//If the code gets here the player isn't in the Walton anymore, so give error message
}

