Coding Help
#1

Does anyone know what the code is for:
Ejecting a player from a vehicle (which I have named 'threshcar' which is AddstaticVehicle etc.) if they are not an RCON admin?

Destroying a previously spawned car if the player tries to spawn another one. Example: I spawn a remington and drive it for a bit, then I want to spawn a landstalker, when my landstalker spawns, the remington disappears. Can someone help me with these 2 codes?
Reply
#2

Ejecting
pawn Код:
//Global
new threshcar;

//OnGameModeInit
threshcar = AddStaticVehicle(................

//OnPlayerStateChange
if(GetPlayerVehicleID(playerid) == threshcar && !IsPlayerAmin(playerid)) RemovePlayerFromVehicle(playerid);
Reply
#3

pawn Код:
new CurrentCar[MAX_PLAYERS];

..

public OnPlayerConnect(playerid) {
   CurrentCar[playerid] = -1;
}

..

//When spawning a car:
if(CurrentCar[playerid] != -1) DestroyVehicle(CurrentCar[playerid]);
CurrentCar[playerid] = CreateVehicle(.......);
Reply
#4

I want it to destroy the previous car if they spawn ANY vehicle.

PS: Whenever I respawn the car or it gets blown up, all the components are gone... how can I fix this?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)