31.07.2011, 22:47
pawn Код:
CMD:vehicle(playerid, params[])
{
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
CreateVehicleEx(GetFreeVehicleSlot(), PName(playerid), 411, X, Y, Z, A, 100);
return 1;
}
stock CreateVehicleEx(ID, Owner[], modelid, Float:X, Float:Y, Float:Z, Float:A, Cost)
{
new vehicleid = CreateVehicle(modelid, X, Y, Z, A, -1, -1, 99999);
VehicleData[ID][VehicleID] = vehicleid;
format(VehicleData[ID][VehicleOwner], 24, Owner);
VehicleData[ID][VehicleX] = X;
VehicleData[ID][VehicleY] = Y;
VehicleData[ID][VehicleZ] = Z;
VehicleData[ID][VehicleA] = A;
VehicleData[ID][VehicleModel] = modelid;
VehicleData[ID][VehicleCost] = Cost;
VehicleData[ID][VehicleSell] = Cost / 2;
return VehicleFreeSlot[ID] = true;
}