Logic help :P
#2

Create a variable that determines how much drugs is on each vehicle
pawn Код:
new vDrugStash[MAX_VEHICLES];
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
pawn Код:
new vehmodel=GetVehicleModel(GetPlayerVehicleID(playerid));
if(vehmodel==478)//478=walton
{
  //buy drugs code
  GivePlayerMoney(playerid,-500);
  vDrugStash[GetPlayerVehicleID(playerid)]+=10;
}
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
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
}
You would then do the same thing but different vehicle models for the dodo to yosemite truck

Reply


Messages In This Thread
Logic help :P - by aNdReSkKkK - 02.02.2010, 01:22
Re: Logic help :P - by Joe Staff - 02.02.2010, 01:56
Re: Logic help :P - by aNdReSkKkK - 02.02.2010, 02:09

Forum Jump:


Users browsing this thread: 1 Guest(s)