[Include] Neons - Attach neons with ease!
#1

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.

Код:
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.
Both functions return 1 on success, 0 on fail.

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
Download
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;
}
Reply
#2

Exelent, , making neons very simple, thanks
Reply
#3

Cool. Good job man.
Reply
#4

AttachObjectToVehicle(
g_NeonObject[ vehicleid ][ 0 ],
vehicleid,
( VehicleData[ arrModel ][ 0 ] / 2 ) - 0.5,
VehicleData[ arrModel ][ 4 ] - VehicleData[ arrModel ][ 4 ], //emm...always 0 here?
VehicleData[ arrModel ][ 5 ] - 0.5,
0.00,
0.00,
0.00 );
Reply
#5

That's good.
Reply
#6

Coool i liked That +Rep
Reply
#7

Great job I'll test it, thank you
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)