/key command help.
#5

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;
}
Reply


Messages In This Thread
/key command help. - by ReneG - 01.02.2012, 04:13
Re: /key command help. - by -ExG-VirusKiller - 01.02.2012, 09:59
Re: /key command help. - by ReneG - 01.02.2012, 12:56
Re: /key command help. - by -ExG-VirusKiller - 01.02.2012, 13:09
Re: /key command help. - by Konstantinos - 01.02.2012, 13:18

Forum Jump:


Users browsing this thread: 1 Guest(s)