11.07.2015, 10:31
(
Last edited by Emmet_; 15/08/2015 at 12:06 PM.
)
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.
Functions:
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.
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
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);
pawn Code:
native IsPlayerInModShop(playerid);
native IsValidComponentForVehicle(vehicleid, componentid);
native GetVehicleComponentPrice(componentid);
native GetComponentName(componentid, name[], len = sizeof(name));
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);
}
}
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