Menu

LEDs

 
      Each player LEDs can be set into one of four states: OFF, ON, FAST BLINK and SLOW BLINK. Letting you program visual indications for specific functions in your GPC script. NOTE: The XBox 360 controller does not support more than one LED lighted at the same time. If you try to light up more than one LED on a XBox 360 controller then the one with the highest index takes the precedence.
 
  Related GPC Functions:
 
get_led       Returns the value of a LED state
set_led       Set the state of a LED
set_ledx      Blinks a LED a certain number of times
get_ledx      Checks if a LED is being blinked by the set_ledx function
reset_leds    Reset the LEDs state to what was set by the console
 
  LED Identifiers:
 
LED_1, LED_2, LED_3, LED_4
 

  1. get_led

      Returns the value of a LED state.
 
  Prototype:
 
int get_led ( <led_ident> )
 
  Parameters:
 
<led_ident>  : the identifier of a LED
 
  Return:
 
0: LED OFF
1: LED ON
2: FAST BLINK
3: SLOW BLINK
 
  Example:
 
if(get_led(LED_1) == 3) {
    /* LED 1 is blinking slowly */
}
 

  2. set_led

      Set the state of a LED.
 
  Prototype:
 
set_led ( <led_ident>, <state> )
 
  Parameters:
 
<led_ident>  : the identifier of a LED
<state>      : 0 to OFF; 1 to ON; 2 to FAST BLINK; 3 to SLOW BLINK
 
  Return:
 
None
 
  Example:
 
set_led(LED_2, 2);
 

  3. set_ledx

      Blinks a LED a certain number of times.
 
  Prototype:
 
set_ledx ( <led_ident>, <blinks> )
 
  Parameters:
 
<led_ident>  : the identifier of a LED
<blinks>     : the number of blinks, can range from 0 to 255
 
  Return:
 
None
 
  Example:
 
set_ledx(LED_4, 12);
 

  4. get_ledx

      Checks if a LED is being blinked by the set_ledx function.
 
  Prototype:
 
int get_ledx (  )
 
  Parameters:
 
None
 
  Return:
 
TRUE if there are LEDs being blinked, FALSE otherwise
 
  Example:
 
if(!get_ledx()) {
    set_ledx(LED_1, 5);
}
 

  5. reset_leds

      Reset the LEDs state to what was set by the console.
 
  Prototype:
 
reset_leds (  )
 
  Parameters:
 
None
 
  Return:
 
None
 
  Example:
 
reset_leds();