[HELP] Seatbelts
#2

Only with a loop:
Код:
public OnVehicleDamageStatusUpdate( vehicleid, playerid )
{    
	new Float:health, str[ 128 ];
	for( new i; i < MAX_PLAYERS; i ++ )
	{
		if( !IsPlayerInVehicle( i, vehicleid ) )
			continue;

		switch( Seatbelt[ playerid ] )
		{
			case 0:
			{
				GetVehicleHealth( vehicleid, vehhealthup[ playerid ] );
				GetPlayerHealth( playerid, health );
				health = health - ( ( vehhealth[ playerid ] - vehhealthup[ playerid ] ) / 10 );
				SetPlayerHealth( playerid, health );
				GetVehicleHealth( vehicleid, vehhealth[ playerid ] );
			}
			case 1:
			{
				GetPlayerName( playerid, str, 128 );
				format( str, 128, "* Seatbelt saves (( %s ))", str );
				ProxDetector( 10.0, playerid, str, COLOR_PINK, COLOR_PINK, COLOR_PINK, COLOR_PINK, COLOR_PINK );
			}
		}
	}
	return 1;
}
Reply


Messages In This Thread
[HELP] Seatbelts - by Dirkon - 11.10.2011, 18:18
Re: [HELP] Seatbelts - by IstuntmanI - 11.10.2011, 18:26

Forum Jump:


Users browsing this thread: 1 Guest(s)