Neon System
#2

y_ini

i dunno if it's id will change after the vehicle got destroyed/respawned
pawn Код:
new neonid[ MAX_VEHICLES ];
//dialogresponse
//if dialogid == ...
//isplayerinanyvehicle
//attachobjecttovehicle ( idk how to use -.- )
new file[ 23 ]; format( file, 64, "v_%d.ini", GetPlayerVehicleID( playerid ) );
new INI:vehFile = INI_Open( file );
new colorid;
neonID[ GetPlayerVehicleID( playerid ) ] = listitem;

switch(listitem)
{
    case 0: colorid = 0; // button 0 ( the first button )
    case 1: colorid = 1; // button 1 ( the second button )

   // and so on
}

// OR A QUICKER WAY WITHOUT SWITCH:
colorid = listitem;

// or just use listitem without any vars in the code below

INI_WriteInt( vehFile, "NEON", listitem );

INI_Close( vehFile );

// onvehiclespawn
new file[ 23 ]; format( file, 23, "v_%d.ini", vehicleid );
if( fexist( file ) ) {
    INI_ParseFile( file, "parseneon", .bExtra = true, .extra = vehicleid );

    switch ( neonid[ vehicleid ] ) {
        case 0: //attachobject with color 0..
        // and so on
    }
}

return 1;

// below ur script
forward parseneon( vehicleid, name[ ], value[ ] );
public parseneon( vehicleid, name[ ], value[ ] )
{
    neonid[ vehicleid ] = INI_Int( "NEON" );

    return 1;
}
?

@vic that one doesnt save the neon afaik
Reply


Messages In This Thread
Neon System - by MuhammadFajar - 09.09.2011, 04:05
Re: Neon System - by Basicz - 09.09.2011, 04:39
Re: Neon System - by uprp - 09.09.2011, 05:33
Re: Neon System - by Horrible - 09.09.2011, 08:24

Forum Jump:


Users browsing this thread: 1 Guest(s)