Jump to content
  • 0

Faruri aprinse manual cu CTRL


qUneT

Question

5 answers to this question

Recommended Posts

Ms am inteles tot

Am pus new light si acu ce fac?

Deja imi dau seama ca tu explodezi la cate cunostinte in scripting ai, asa ca o sa iti dau un exemplu (defapt, ceva mai mult de un exemplu):

#define PRESSED(%0) \

(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))

new

    bool: lights_status [ MAX_PLAYERS ]        ,

    vehicleid = GetPlayerVehicleID ( playerid ) ,

    engine    ,    lights    ,    alarm    ,

    doors      ,    bonnet    ,    boot      ,

    objective 

;

public OnPlayerKeyStateChange ( playerid , newkeys , oldkeys )

{

  if ( PRESSED ( KEY_FIRE ) && lights_status [ playerid ] == false )

    {

        if ( IsPlayerInAnyVehicle ( playerid ) )

        {

            GetVehicleParamsEx ( vehicleid , engine , lights , alarm , doors , bonnet , boot , objective ) ;

            SetVehicleParamsEx ( vehicleid , engine , 1      , alarm , doors , bonnet , boot , objective ) ;

            lights_status [ playerid ] = true ;

    }

    }

    if ( PRESSED ( KEY_FIRE ) && lights_status [ playerid ] == true )

    {

      if ( IsPlayerInAnyVehicle ( playerid ) )

        {

            GetVehicleParamsEx ( vehicleid , engine , lights , alarm , doors , bonnet , boot , objective ) ;

            SetVehicleParamsEx ( vehicleid , engine , lights , alarm , doors , bonnet , boot , objective ) ;

            lights_status [ playerid ] = false ;

    }

    }

  return ( 1 ) ;

}

Nu cred ca mai e nevoie sa explic ce face fiecare functie in parte pentru ca, cred eu, o sa o fac degeaba.Succes!

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.