01.02.2012, 13:18
pawn Код:
new
iengine, ilights, ialarm, idoors, iboot, ibonnet, iobjective;
public OnPlayerStateChange( playerid, newstate, oldstate )
{
if( oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER )
{
new
VID = GetPlayerVehicleID( playerid );
switch(VID)
{
case 1 .. 100:
{
GetVehicleParamsEx( VID, iengine, ilights, ialarm, idoors, iboot, ibonnet, iobjective );
SetVehicleParamsEx( VID, 0, ilights, ialarm, idoors, iboot, ibonnet, iobjective );
return 1;
}
}
}
return 1;
}
CMD:key( playerid, params[ ] )
{
new
vid = GetPlayerVehicleID( playerid );
GetVehicleParamsEx( vid, iengine, ilights, ialarm, idoors, iboot, ibonnet, iobjective );
if( IsPlayerInAnyVehicle( playerid ) )
{
if( iengine == 0 ) // I am not sure about this if it's work.
{
SendClientMessage( playerid, COLOR_WHITE, "Vehicle started." );
SetVehicleParamsEx( vid, 1, ilights, ialarm, idoors, ibonnet, iboot, iobjective );
return 1;
}
else if( iengine == 1 )
{
SendClientMessage( playerid, COLOR_WHITE, "Vehicle started." );
SetVehicleParamsEx( vid, 0, ilights, ialarm, idoors, ibonnet, iboot, iobjective );
return 1;
}
}
return 1;
}