SA-MP Forums Archive
OnPlayerVehicleDamage !passenger! - 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: OnPlayerVehicleDamage !passenger! (/showthread.php?tid=552109)



OnPlayerVehicleDamage !passenger! - Slicebook - 22.12.2014

Hi, how to fix?

the driver is injured,the passenger's nothing wrong.

Code:
Код:
public OnPlayerVehicleDamage(playerid, vehicleid, Float:Damage)
{		
	new Float: HP;
	GetPlayerHealth(playerid, HP);
	new Float: PosXa, Float: PosYa, Float: PosZa;
		
	new newstate = GetPlayerState(playerid);	
        if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER){
						if( Damage > 155.0 && 190.0 ){
						Cselekves(playerid,"easily damaged.");
				 		SetPlayerDrunkLevel(playerid, 5000);
			  			SetTimerEx("Szedules", 30000, 0, "d", playerid);
			  			SetPlayerHealth(playerid, HP - 20);}
					}
		}
	return 1;
}



Re: OnPlayerVehicleDamage !passenger! - Slicebook - 23.12.2014

help?