spawn car with VehicleID
#5

Okay make an array like this

pawn Код:
new AdminCars[100]; // 100 is the amoun tof mars (starting from 0 - 99
Now under OnGameModeInit()

pawn Код:
AdminCars[0] = AddStaicVehicle(..);
AdminCars[1] = AddStaticVehicle(..); // defines a vehicle id to an array number
Now you can make the command

I'm going to do this in zmcd as thats most common if you'd like a differnt command type tell me

pawn Код:
CMD:veh(playerid)
{
      new Float:Pos[3];
     if(PlayerInfo[playerid][pAdmin] >= level) // is admin level higher or eual to.
     new car = Random(sizeof(AdminCars)); // getting  random car
     GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]); // getting the admins pos to know where to put the car
     SetVehiclePos(car, Pos[0], Pos[1], Pos[2]); // placing the vehicle where the player is
     PutPlayerInVehicle(playerid, car, 0); // Putting him in the car
     return 1; // ending the command
}
NOTE: CHANGE the Admin Vehicle array to the mount of cars you have OR the command wont work if a car doesnt exist!


UNTESTED!

EDIT: Thanks a bunch for adding your command AFTER I slaved over this, great help!
Reply


Messages In This Thread
spawn car with VehicleID - by ThamburaaN - 22.04.2012, 16:41
Re: spawn car with VehicleID - by MP2 - 22.04.2012, 16:44
Re: spawn car with VehicleID - by ThamburaaN - 22.04.2012, 16:50
Re: spawn car with VehicleID - by Roel - 22.04.2012, 16:53
Re: spawn car with VehicleID - by IceCube! - 22.04.2012, 16:55
Re: spawn car with VehicleID - by ThamburaaN - 22.04.2012, 17:15
Re: spawn car with VehicleID - by IceCube! - 22.04.2012, 17:16
Re: spawn car with VehicleID - by ThamburaaN - 22.04.2012, 17:35

Forum Jump:


Users browsing this thread: 1 Guest(s)