03.04.2016, 00:26
Quote:
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) |
pawn Код:
#pragma tabsize 0
pawn Код:
#define MAX_CAR_OBJECTS ( 10 )
new CarObject [ MAX_PLAYERS ] [ MAX_OBJECTS ] ;
pawn Код:
CarObject [ playerid ] [ object_number ] = ...
and instead of doing
pawn Код:
else
{
SendClientMessage(playerid, 0xFFFFFFFF, "You need proper vehicle first.");
}
pawn Код:
else return SendClientMessage(playerid, 0xFFFFFFFF, "You need proper vehicle first.");
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