[Include] OnVehicleModEx
#1

OnVehicleModEx

Just a simple include which provides more control over the San Andreas tuning garages. For example, if your script has money cheating protection then you can just deduct the price of the component from the money variable in the script.

pawn Code:
public OnVehicleModEx(playerid, vehicleid, componentid, price, illegal);
Functions:

pawn Code:
native IsPlayerInModShop(playerid);
native IsValidComponentForVehicle(vehicleid, componentid);
native GetVehicleComponentPrice(componentid);
native GetComponentName(componentid, name[], len = sizeof(name));
There are also two constants: MIN_COMPONENT_ID and MAX_COMPONENT_ID. Each of these values represent the minimum valid component ID, and the maximum valid component ID, respectively.

pawn Code:
print("The Sultan has the following valid components:");

for (new i = MIN_COMPONENT_ID; i <= MAX_COMPONENT_ID; i ++)
{
    if (IsValidComponentForVehicle(gSultan, i))
    {
        printf("- %i", i);
    }
}
It also has protection over invalid modifications to prevent players from crashing. Also, any attempt to modify a vehicle outside a tuning garage or as a passenger will discard the modification, and "illegal" will be set to true.

Credits to JernejL for the list of legal mods which can be found here.

Download: https://www.dropbox.com/s/lf3u8c9j84...ModEx.inc?dl=1
Reply


Messages In This Thread
OnVehicleModEx - by Emmet_ - 11.07.2015, 10:31
Re: OnVehicleModEx - by PT - 11.07.2015, 10:49
Re: OnVehicleModEx - by Gasman - 11.07.2015, 10:51
Re: OnVehicleModEx - by kristo - 11.07.2015, 11:06
Re: OnVehicleModEx - by Emmet_ - 11.07.2015, 11:14
Re: OnVehicleModEx - by kristo - 11.07.2015, 11:26
Re: OnVehicleModEx - by Emmet_ - 07.08.2015, 10:56
Re: OnVehicleModEx - by dominik523 - 15.08.2015, 11:36
Re: OnVehicleModEx - by Kyle - 15.08.2015, 11:47
Re : OnVehicleModEx - by Dutheil - 15.08.2015, 14:03

Forum Jump:


Users browsing this thread: 1 Guest(s)