07.07.2012, 16:15
pawn Код:
new vehicleid2;
forward CarSpawner2(playerid,model);
public CarSpawner2(playerid,model)
{
if(PlayerInfo[playerid][pCar2] != -1) CarDeleter2(PlayerInfo[playerid][pCar2]);
vehicleid2 = CreateVehicle(model, VehicleX, VehicleY, VehicleZ, VehicleAngle, -1, -1, -1);
ChangeVehicleColor(vehicleid2,0,0);
PlayerInfo[playerid][pCar2] = vehicleid2;
}
forward CarDeleter2(vehicleid);
public CarDeleter2(vehicleid)
{
for(new i=0;i<MAX_PLAYERS;i++)
{
SetVehicleParamsForPlayer(vehicleid,i,0,1);
}
SetTimerEx("VehRes2",500,0,"i",vehicleid);
}
forward VehRes2(vehicleid);
public VehRes2(vehicleid)
{
DestroyVehicle(vehicleid);
}
public OnVehicleSpawn(vehicleid)
{
for(new i=0;i<MAX_PLAYERS;i++)
{
if(vehicleid==PlayerInfo[i][pCar2])
{
CarDeleter2(vehicleid);
PlayerInfo[i][pCar2]=-1;
}
}
return 1;
}