22.04.2012, 16:55
Okay make an array like this
Now under OnGameModeInit()
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
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!
pawn Код:
new AdminCars[100]; // 100 is the amoun tof mars (starting from 0 - 99
pawn Код:
AdminCars[0] = AddStaicVehicle(..);
AdminCars[1] = AddStaticVehicle(..); // defines a vehicle id to an array number
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
}
UNTESTED!
EDIT: Thanks a bunch for adding your command AFTER I slaved over this, great help!

