16.10.2010, 01:17
Guys... I've tried just about everything, but I can't get it working. I have this command:
* Which, for some reason won't put the player in the vehicle...
When a player leaves the vehicle, which was spawned using this command, I want to destroy it. How could I do that?
pawn Code:
command(spawncar, playerid, params[])
{
new carid, color1, color2, Float: CarToX, Float: CarToY, Float: CarToZ;
if(PlayerStatistics[playerid][pAdminLevel] < 3)
return false;
if(sscanf(params, "ddd", carid, color1, color2))
return SendClientMessage(playerid, COLOR_WHITE, "SYNTAX: /spawncar [modelid] [color1] [color2]");
if(carid < 400 || carid > 611)
return SendClientMessage(playerid, COLOR_WHITE, "Wrong vehicle model ID! (400 - 600))!");
if(color1 < 0 || color1 > 300 || color2 < 0 || color2 > 300)
return SendClientMessage(playerid, COLOR_WHITE, "Wrong color ID! (0 - 300)");
GetPlayerPos(playerid, CarToX, CarToY, CarToZ);
AdminVehicle[playerid] = CreateVehicle(carid, CarToX, CarToY, CarToZ, 90, color1, color2, -1);
LinkVehicleToInterior(AdminVehicle[playerid], GetPlayerInterior(playerid));
PutPlayerInVehicle(playerid, AdminVehicle[playerid], 0);
return 1;
}
When a player leaves the vehicle, which was spawned using this command, I want to destroy it. How could I do that?