08.01.2011, 22:01
ok, I have problem with engine. I using ManualVehicleEngineAndLights functions, but... When I enter any car after server restart I get message that vehicle engine is ON ( But wtf, Im using ManualVehicleEngineAndLights function ) When I press H, it's ok. When timer ends, and I get engine is succesfully ( in eng, not lt ) . . . . engine is OFF, but not on
Script:
Script:
pawn Код:
if( HOLDING( KEY_CROUCH ) )
{
if( IsPlayerInAnyVehicle( playerid ) && GetPlayerState( playerid ) == PLAYER_STATE_DRIVER )
{
new
Masina = GetPlayerVehicleID( playerid )
;
if( GetVehicleModel( GetPlayerVehicleID( playerid ) ) != 481 || GetVehicleModel( GetPlayerVehicleID( playerid ) ) != 509 || GetVehicleModel( GetPlayerVehicleID( playerid ) ) != 510 )
{
GetVehicleParamsEx( Masina, Variklis, Lempos, Signalizacija, Uzrakinimas, Kapotas, Bagazine, Lempute );
if( !Variklis )
{
SendClientMessage( playerid, -1, ""#h_Balta"[ > ] "#h_Geltona"Maрinos variklis "#h_Raudona"kuriamas" );
SetTimerEx( "MasinosVariklis", 4500, false, "d", playerid, Masina );
}
if( Variklis )
{
SendClientMessage( playerid, -1, ""#h_Balta"[ > ] "#h_Geltona"Maрinos variklis "#h_Raudona"uюgesintas" );
SetVehicleParamsEx( Masina, false, Lempos, Signalizacija, Uzrakinimas, Kapotas, Bagazine, Lempute );
}
}
}
}
pawn Код:
forward MasinosVariklis( playerid, vehicleid );
public MasinosVariklis( playerid, vehicleid )
{
new
Random = random( 4 ),
Float: Gyvybes
;
GetVehicleHealth( vehicleid, Gyvybes );
GetVehicleParamsEx( vehicleid, Variklis, Lempos, Signalizacija, Uzrakinimas, Kapotas, Bagazine, Lempute );
if( Random == 0 || Random == 1 ) SetVehicleParamsEx( vehicleid, true, Lempos, Signalizacija, Uzrakinimas, Kapotas, Bagazine, Lempute ), SendClientMessage( playerid, -1, ""#h_Balta"[ > ] "#h_Geltona"Variklis "#h_Zalia"sлkmingai uюsikыrл." );
if( Random == 2 || Random == 3 ) SendClientMessage( playerid, -1, ""#h_Balta"[ > ] "#h_Geltona"Variklis "#h_Raudona"neuюsikыrл." );
if( Gyvybes <= 650 ) return SendClientMessage( playerid, -1, ""#h_Balta"[ > ] "#h_Geltona"Maрina yra per "#h_Raudona"daug sudauюyta" );
if( MasinuDB[ vehicleid ][ Degalai ] == 0 ) return SendClientMessage( playerid, -1, ""#h_Balta"[ > ] "#h_Geltona"Maрinoje "#h_Raudona"nлra "#h_Geltona"degalш" );
return true;
}