[Pedido] Motor
#1

Alguem poderia me passar um sistema, que quando a vida do veiculo chegar por exemplo em 100.0, o veiculo nгo andar mais, ate o mecanico reparar o veiculo, alguem poderia me passar??
Reply
#2

mano Pesquisa ae.
https://sampforum.blast.hk/showthread.php?tid=324711
Reply
#3

Quote:
Originally Posted by GuiKommander
Посмотреть сообщение
Pesquisei sim, e cheguei nesse mesmo tуpico ae, porem esse sistema que esta neste topнco esta todo bugado, por isso vim aki fazer o PEDIDO
Reply
#4

Aqui estб uma base:
Код:
public OnGameModeInit()
{
    SetTimer("CheckVehicles", 1000, true);
	return 1;
}

forward CheckVehicles();
public CheckVehicles()
{
	for(new i = 0, m = GetPlayerPoolSize()+1; i < m; i++)
	{
	    if(IsPlayerConnected(i))
	    {
	        if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
	        {
	            new v = GetPlayerVehicleID(i), Float:health;
	            new engine, lights, alarm, doors, bonnet, boot, objective;
				GetVehicleParamsEx(v, engine, lights, alarm, doors, bonnet, boot, objective);
				GetVehicleHealth(v, health);
				
				if(health <= 100.0 && engine == VEHICLE_PARAMS_ON)
				{
					SetVehicleParamsEx(v, VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective);
					SendClientMessage(i, -1, "O motor do seu veнculo parou de funcionar");
				}
	        }
	    }
	}
	return 1;
}

stock RepararMotor(vehicleid)
{
	SetVehicleHealth(vehicleid, 1000);
	new engine, lights, alarm, doors, bonnet, boot, objective;
	GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
    SetVehicleParamsEx(vehicleid, VEHICLE_PARAMS_ON, lights, alarm, doors, bonnet, boot, objective);
	return 1;
}
Reply
#5

@edit
nгo li o tуpico direto
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)