[FilterScript] beckzy's mod shops
#1

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
Reply
#2

Nice filterscript,
I downloaded it.
Reply
#3

////
Reply
#4

I like the script, but I just noticed one major flaw: AFAIK, Kalcor removed CreateMenu function from SA-MP recently.. I remember reading a reply in Everything & Nothing about how its rarely used on servers or something.
Reply
#5

Quote:
Originally Posted by Chaprnks
View Post
I like the script, but I just noticed one major flaw: AFAIK, Kalcor removed CreateMenu function from SA-MP recently.. I remember reading a reply in Everything & Nothing about how its rarely used on servers or something.
CreateMenu was patched, not removed. It still exists.

Edit - 03/04/2020:

- Fixed Dumper being allowed in Transfender (it isn't moddable)
- Fixed invalid components not being filtered on aircraft and trailers
Reply
#6

Github?
Reply
#7

one question! do you have a menu editor?
Reply
#8

Quote:
Originally Posted by Dice_
View Post
Github?
It's 1 file lol.

Quote:
Originally Posted by Mobtiesgangsa
View Post
one question! do you have a menu editor?
No sorry. I got the menu info from main.scm to make them identical to the default mod shops.
Reply
#9

I don't know if this is a bug but when selecting an option from Wheel Arch Angels (tried that modshop only), such as Respray or Exaust or anything in that menu, the interior is not visible anymore aswell the vehicle. (Blank screen)

But the menu is still visibile.
Reply
#10

Quote:
Originally Posted by Symon
View Post
I don't know if this is a bug but when selecting an option from Wheel Arch Angels (tried that modshop only), such as Respray or Exaust or anything in that menu, the interior is not visible anymore aswell the vehicle. (Blank screen)

But the menu is still visibile.
It's fixed now, please re-download. Thanks for reporting.

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

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)