[FilterScript] beckzy's mod shops

Started by SA:MP, May 10, 2023, 02:54 PM

Previous topic - Next topic

0 Members and 7 Guests are viewing this topic.

EllisRhilt

Автообзоры https://proauto.kyiv.ua тест-драйвы, новости рынка и советы экспертов. Узнавайте всё о новых моделях и автоаксессуарах на нашем портале!

SA:MP

[FilterScript] beckzy's mod shops

This is a filterscript for server side mod shops. It requires Incognito's streamer plugin for the use of dynamic checkpoints. There are pros and cons to using scripted mod shops:



Pros:

- Most land vehicles can be modded

- Front/rear bumpers AND front/rear bullbars can be applied together

- All wheels are listed for all moddable vehicles

- You can change the paintjob of Camper

- OnVehicleRespray2, OnVehiclePaintjob2, and OnVehicleMod2 are used. OnVehicleRespray2 isn't called when you view a component or when you leave a mod shop (unlike OnVehicleRespray) , and OnVehiclePaintjob2 isn't called when you view a paintjob (unlike OnVehiclePaintjob)

- As all valid components are stored for each vehicle model, OnVehicleMod filters out any invalid components added through hacks



Cons:

- You can't choose the vehicle color, though you can still Respray the vehicle to the next default color



Notes:

- OnVehicleRespray2, OnVehiclePaintjob2, and OnVehicleMod2 are called through all scripts

- You might want to move the following into an include if you're restoring paintjobs/components in other scripts:


Code:

new vpaintjob[MAX_VEHICLES] = {3, ...};
new vcompids[MAX_VEHICLES][MAX_COMPONENT_TYPES];

as well as AddVehicleComponent2, RemoveVehicleComponent2, and the vehiclemodinfo array.



- When destroying a vehicle (DestroyVehicle) you should reset the paintjob/components. Example:


Code:

vpaintjob[vehicleid-1] = 3;

for (new c = 0; c < MAX_COMPONENT_TYPES; c++)
{
vcompids[vehicleid-1][c] = 0;
}

Edit - 03/04/2020:



- Fixed Dumper being allowed in Transfender (it isn't moddable)

- Fixed invalid components not being filtered on aircraft and trailers



Edit2 - 03/04/2020:



- Fixed entering Loco Low Co and Wheel Arch Angels setting the wrong mod shop ID



Edit - 25/04/2020:



- When the mod shop menu is destroyed pmodshopmenu is set to Menu:INVALID_MENU instead of Menu:0

- Sound ID 1055 "SOUND_SHOP_BUY_DENIED" is played with the "You don't have enough money to buy this item." text when you try to respray, buy a paint job, or buy a component without enough money

- Added a second text draw displaying "You have already bought this item!" if you try to select a one type component that you've already bought (e.g. Hydraulics) . Sound ID 1055 "SOUND_SHOP_BUY_DENIED" will also be played when this text shows



Video (thanks Deadsh0ty) - https://www.youtube.com/watch?v=VZQgn5SkWo4



Download - click

Source: [FilterScript] beckzy's mod shops