Cars destroying when player leaves - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Cars destroying when player leaves (
/showthread.php?tid=380189)
Cars destroying when player logs out -
fordawinzz - 24.09.2012
As I said in the title, I want to destroy a players car, without messing up the vehicle IDs. I know how to do it, but the vehicle IDs are messing up... Does anyone have any solutions?
Re: Cars destroying when player leaves -
MrPlatinum - 24.09.2012
I'm confused why do you exactly want to destroy someones car?
Also i don't know how some Gamemodes work. But if you are admin you could delete the car yourself.
Re: Cars destroying when player leaves -
fordawinzz - 24.09.2012
because of the vehicle's limit and for the space...
Re: Cars destroying when player leaves -
XtremeR - 24.09.2012
here ya go
pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
new xveh;
xveh = GetPlayerVehicleID(playerid);
DestroyVehicle(xveh);
return 1;
}
Re: Cars destroying when player leaves -
fordawinzz - 24.09.2012
Quote:
Originally Posted by XtremeR
here ya go
pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid) { new xveh; xveh = GetPlayerVehicleID(playerid); DestroyVehicle(xveh); return 1; }
|
.....
Re: Cars destroying when player leaves -
Danyal - 24.09.2012
ONE WAY
pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
if(GetPlayerState(playerid)==PLAYER_STATE_DRIVER)
{
DestroyVehicle(vehicleid);//thats supposed to be in the timer. no slapping out
}
}
ANOTHER WAY [UNTESTED]
pawn Код:
new bool:IsDriver[MAX_PLAYERS] = false;
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate==PLAYER_STATE_DRIVER)
{
IsDriver[playerid]=true;
}
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
if(IsDriver)
{
new currentveh;
currentveh = GetPlayerVehicleID(playerid);
DestroyVehicle(currentveh);
IsDriver[playerid]=false;
}
return 1;
}
Re: Cars destroying when player leaves -
fordawinzz - 24.09.2012
I said, I know how to do this, but I need to know how to make the vehicle IDs not to mess up. All of you didn't read ... When the player LOGS OUT.