onplayerdissconnect problem
#1

Hey guys,

How would I make it so when people disconnect there cars unload?

On server load, public LoadCar()

How would I make it so when they log-off, there car disconnects.
Reply
#2

Save the ID of the vehicle when it's created.
Код:
new veh[MAX_PLAYERS];
veh[playerid] = CreateVehicle()

Then under OnPlayerDisconnect do:
DestroyVehicle(veh[playerid]);
Reply
#3

Quote:
Originally Posted by UnknownGamer
Посмотреть сообщение
Hey guys,

How would I make it so when people disconnect there cars unload?

On server load, public LoadCar()

How would I make it so when they log-off, there car disconnects.
You can use DestroyVehicle() in OnPlayerDisconnect, it takes a vehicle ID as parameter, so you'll have to store the player's personal vehicle ID and provide it to that function.
Reply
#4

new currentveh;
currentveh = GetPlayerVehicleID(playerid);
DestroyVehicle(currentveh);

Would that work with Ravens Roleplay? so there car unloads when they log out and re-load when they log back in?
Reply
#5

Quote:
Originally Posted by UnknownGamer
Посмотреть сообщение
new currentveh;
currentveh = GetPlayerVehicleID(playerid);
DestroyVehicle(currentveh);

Would that work with Ravens Roleplay? so there car unloads when they log out and re-load when they log back in?
Never saw Ravens Roleplay code, but I guess it should work fine.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)