30.12.2011, 19:29
(
Последний раз редактировалось Psymetrix; 31.12.2011 в 11:07.
)
Introduction
This include allows you to attach neons to vehicles without any having to bother about finding the right positions.
It uses THIS list, created by JernejL, to automatically get the correct positions for the neons.
This may not be 100% accurate for all vehicles, especially boats but as far as I have tested, It's pretty damn close.
Functions
There are two functions.
Both functions return 1 on success, 0 on fail.
Neon Colors
Download
Slightly fixed version: Pastebin.com
It seems that the chassis offsets don't work as well as I first thought.
Example
This include allows you to attach neons to vehicles without any having to bother about finding the right positions.
It uses THIS list, created by JernejL, to automatically get the correct positions for the neons.
This may not be 100% accurate for all vehicles, especially boats but as far as I have tested, It's pretty damn close.
Functions
There are two functions.
Код:
AttachNeons( vehicleid, color ); This function allows you to attach neons to a vehicle. You do not have to give positions as they are stored in the include. Colors are defined in the include ( or see below ). Existing neons will be removed from the vehicle before attaching new ones.
Код:
RemoveNeons( vehicleid ); Use this function to remove neons attached using this include.
Neon Colors
Код:
#define NEON_RED 18647 // RedNeonTube1 #define NEON_BLUE 18648 // BlueNeonTube1 #define NEON_GREEN 18649 // GreenNeonTube1 #define NEON_YELLOW 18650 // YellowNeonTube1 #define NEON_PINK 18651 // PinkNeonTube1 #define NEON_WHITE 18652 // WhiteNeonTube1
Slightly fixed version: Pastebin.com
It seems that the chassis offsets don't work as well as I first thought.
Example
pawn Код:
COMMAND:attach( playerid, params[] )
{
#pragma unused params
if ( GetPlayerState( playerid ) == PLAYER_STATE_DRIVER )
{
static neons[ 5 ] = {NEON_RED, NEON_GREEN, NEON_BLUE, NEON_WHITE, NEON_YELLOW};
AttachNeons( GetPlayerVehicleID( playerid ), neons[ random( sizeof neons ) ] );
}
else
SendClientMessage( playerid, -1, "You must be driving a vehicle to use this command." );
return 1;
}
COMMAND:remove( playerid, params[] )
{
#pragma unused params
if ( GetPlayerState( playerid ) == PLAYER_STATE_DRIVER )
RemoveNeons( GetPlayerVehicleID( playerid ) );
else
SendClientMessage( playerid, -1, "You must be driving a vehicle to use this command." );
return 1;
}