[FilterScript] Racing/tuner decals on non-tuner vehicles!
#4

Quote:
Originally Posted by darles92
Посмотреть сообщение
Ye, code is bit mess, I plan to clear it up, also what to improve in code itself?
I'm still learning, this is my 1st FS done in samp.
Was nightmare to get proper car body coords (XYZ, rXrYrZ) for these decals, also wanted fonts similar to ones used in tuner cars (SPLIT/ALIEN logos for example)
dont use
pawn Код:
#pragma tabsize 0
try using 2 dimensional arrays
pawn Код:
#define MAX_CAR_OBJECTS  ( 10 )

new CarObject [ MAX_PLAYERS ] [ MAX_OBJECTS ] ;
Usage

pawn Код:
CarObject [ playerid ] [ object_number ] = ...
try using zcmd instead of strcmp commands

and instead of doing

pawn Код:
else
{
SendClientMessage(playerid, 0xFFFFFFFF, "You need proper vehicle first.");
}
do this
pawn Код:
else return SendClientMessage(playerid, 0xFFFFFFFF, "You need proper vehicle first.");
imho its pointless to use brackets when ur only using up only one line. i only use brackets if im adding more than one line inbetween them.

also, under onvehicledeath & spawn you use vehicleid instead of playerid, so it will spawn/despawn the wrong objects.

you could also shorten the code a lot by making it compatible with every car, not just a select few. you can do this by creating a function that does all the work for you. there's tons of includes with car offsets, maybe you could use those for it
Reply


Messages In This Thread
Racing/tuner decals on non-tuner vehicles! - by darles92 - 03.04.2016, 00:06
Re: Racing/tuner decals on non-tuner vehicles! - by Dignity - 03.04.2016, 00:09
Re: Racing/tuner decals on non-tuner vehicles! - by darles92 - 03.04.2016, 00:14
Re: Racing/tuner decals on non-tuner vehicles! - by Dignity - 03.04.2016, 00:26
Re: Racing/tuner decals on non-tuner vehicles! - by darles92 - 03.04.2016, 00:43
Re: Racing/tuner decals on non-tuner vehicles! - by Luis- - 16.05.2016, 19:19
Re: Racing/tuner decals on non-tuner vehicles! - by Pottus - 17.05.2016, 00:41
Re: Racing/tuner decals on non-tuner vehicles! - by Skudinhu - 18.05.2016, 20:17
Re: Racing/tuner decals on non-tuner vehicles! - by JawsCraft - 19.05.2016, 14:19

Forum Jump:


Users browsing this thread: 2 Guest(s)