Car Spawning
#1

How do I make the car destroy itself when the player exits the car.

Код:
 case 7: // Car
		{
		    new Float:X,Float:Y,Float:Z,
			carid;
			carid = strval(inputtext);
			GetPlayerPos(playerid, X,Y,Z);
			AddStaticVehicle(carid,X+3.0,Y,Z,0.0,0,0);
            ShowPlayerDialog(playerid, 19, DIALOG_STYLE_MSGBOX, "Spawning", "Car Spawned", "Ok", "");
			if(IsPlayerInAnyVehicle(playerid)){

			}
			}
Reply
#2

You don't have to:
pawn Код:
CreateVehicle(carid,X+3.0,Y,Z,0.0,0,0,-1);
This code will prevent it from respawning when the player exits a car.
Reply
#3

pawn Код:
public OnPlayerExitVehicle(playerid,vehicleid)
{
    DestroyVehicle(vehicleid);
    return 1;
}
Reply
#4

pawn Код:
new pvehicle[MAX_PLAYERS];

pvehicle[playerid] = CreateVehicle(..............);

public OnPlayerExitVehicle(playerid,vehicleid)
{
    DestroyVehicle(pvehicle[playerid]);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)