SA-MP Forums Archive
OnPlayerExitVehicle - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: OnPlayerExitVehicle (/showthread.php?tid=168241)



OnPlayerExitVehicle - cruising - 15.08.2010

Hello!

How do i reset a player skin he had before he enter the Rhino? You have the enter code here to. I have made it this far only
Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
	if (OnPlayerExitVehicle(vehicleid, 432)
  		)
	return 1;
}
when you enter a Rhino you get the army skin, i made it like this
Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	if (PlayerEnterVehicle(vehicleid, 432)
		)
		SetPlayerSkin(playerid, 287);
	return 1;
}
but i get warning 206: redundant test: constant expression is non-zero.. (line 4) ")" why? The player gets the army skin even when he enters a Rustler and get freezed :S im sure i will get the same on the exit code.

And if someone could help me with how to give score for players when killing a vehicle (with a player inside it of course) i would be happy!


Re: OnPlayerExitVehicle - Redgie - 15.08.2010

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if (GetVehicleModel(vehicleid) == 432) //Sets the players skin upon entering the rhino
    {
        SetPlayerSkin(playerid, 287);
        return 1;
    }
}
pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
    if (GetVehicleModel(vehicleid) == 432)
    {
        SetPlayerSkin(playerid, skin); //Replace skin with the skin you want them to have upon exiting the rhino
        return 1;
    }
}
NOTE: This will change the skin when they begin entering the vehicle, which means if they enter but then cancel, they will still be given the skin, consider using OnPlayerStateChange instead


Re: OnPlayerExitVehicle - cruising - 15.08.2010

Quote:
Originally Posted by Redgie
Посмотреть сообщение
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if (GetVehicleModel(vehicleid) == 432) //Sets the players skin upon entering the rhino
    {
        SetPlayerSkin(playerid, 287);
        return 1;
    }
}
pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
    if (GetVehicleModel(vehicleid) == 432)
    {
        SetPlayerSkin(playerid, skin); //Replace skin with the skin you want them to have upon exiting the rhino
        return 1;
    }
}
NOTE: This will change the skin when they begin entering the vehicle, which means if they enter but then cancel, they will still be given the skin, consider using OnPlayerStateChange instead
Thanks allot! isnt it a way to just reset the skin to what i had before enter the rhino?


Re: OnPlayerExitVehicle - Cameltoe - 15.08.2010

You could OnPlayerEnteVehicle start a timer to check if the player is in the rhino if hes not then set skin back to normal.


Re: OnPlayerExitVehicle - cruising - 15.08.2010

Quote:
Originally Posted by Cameltoe
Посмотреть сообщение
You could OnPlayerEnteVehicle start a timer to check if the player is in the rhino if hes not then set skin back to normal.
oh god,,and i who sux on timers :/


Re: OnPlayerExitVehicle - cruising - 15.08.2010

Quote:
Originally Posted by Redgie
Посмотреть сообщение
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if (GetVehicleModel(vehicleid) == 432) //Sets the players skin upon entering the rhino
    {
        SetPlayerSkin(playerid, 287);
        return 1;
    }
}
pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
    if (GetVehicleModel(vehicleid) == 432)
    {
        SetPlayerSkin(playerid, skin); //Replace skin with the skin you want them to have upon exiting the rhino
        return 1;
    }
}
NOTE: This will change the skin when they begin entering the vehicle, which means if they enter but then cancel, they will still be given the skin, consider using OnPlayerStateChange instead
OnPlayerExitVehicle did not work. and crash the game