Closing garages in 0.3.8 -
beckzy - 04.12.2017
Most of you know already that removing garage doors and re-adding them at the same position will cause your game to crash. SA-MP 0.3.8 brings AddSimpleModel. You can use AddSimpleModel to duplicate the doors then add them, and it won't crash your game! This post shows you how you can disable mod shops, PayNSprays, and bomb shops (I'll probably add other garages in the future). Unfortunately the LV bomb shop doors aren't solid and would need editing to fix that; however the LS bomb shop door is identical in size & texture to the LV bomb shop doors - so we'll be using the LS bomb shop door to close the LV bomb shops as well (you would never notice the difference anyway). Also note that El Quebrados PayNSpray and Fort Carson PayNSpray use the same object ("cxf_spraydoor1.dff", "cxrf_payspray.txd") so it only needs to be added once.
OnPlayerConnect
Code:
// mod shops
RemoveBuildingForPlayer(playerid, 5340, 2644.8594, -2039.2344, 14.0391, 1.0);
RemoveBuildingForPlayer(playerid, 5779, 1041.3516, -1025.9297, 32.6719, 1.0);
RemoveBuildingForPlayer(playerid, 10575, -2716.3516, 217.4766, 5.3828, 1.0);
RemoveBuildingForPlayer(playerid, 11313, -1935.8594, 239.5313, 35.3516, 1.0);
RemoveBuildingForPlayer(playerid, 9093, 2386.6563, 1043.6016, 11.5938, 1.0);
// pay n sprays
RemoveBuildingForPlayer(playerid, 5422, 2071.4766, -1831.4219, 14.5625, 1.0);
RemoveBuildingForPlayer(playerid, 5856, 1024.9844, -1029.3516, 33.1953, 1.0);
RemoveBuildingForPlayer(playerid, 6400, 488.2813, -1734.6953, 12.3906, 1.0);
RemoveBuildingForPlayer(playerid, 11319, -1904.5313, 277.8984, 42.9531, 1.0);
RemoveBuildingForPlayer(playerid, 9625, -2425.7266, 1027.9922, 52.2813, 1.0);
RemoveBuildingForPlayer(playerid, 7891, 1968.7422, 2162.4922, 12.0938, 1.0);
RemoveBuildingForPlayer(playerid, 13028, 720.0156, -462.5234, 16.8594, 1.0);
RemoveBuildingForPlayer(playerid, 3294, -1420.5469, 2591.1563, 57.7422, 1.0);
RemoveBuildingForPlayer(playerid, 3294, -100.0000, 1111.4141, 21.6406, 1.0);
// bomb shops
RemoveBuildingForPlayer(playerid, 5043, 1843.3672, -1856.3203, 13.8750, 1.0);
RemoveBuildingForPlayer(playerid, 7707, 2006.0000, 2317.6016, 11.3125, 1.0);
RemoveBuildingForPlayer(playerid, 7709, 2006.0000, 2303.7266, 11.3125, 1.0);
OnGameModeInit
Code:
// mod shops
AddSimpleModel(-1, 5340, -1001, "modlas2.dff", "lasground2_las2.txd");
AddSimpleModel(-1, 5779, -1002, "garagdoor1_lawn.dff", "garaged_lawn.txd");
AddSimpleModel(-1, 10575, -1003, "modshopdoor1_sfs.dff", "subshops_sfs.txd");
AddSimpleModel(-1, 11313, -1004, "modshopdoor_sfse.dff", "carshow_sfse.txd");
AddSimpleModel(-1, 9093, -1005, "cmdgrgdoor_lvs.dff", "vgselckupgrgdr.txd");
CreateObject(-1001, 2644.8594, -2039.2344, 14.0391, 0.0, 0.0, 270.0);
CreateObject(-1002, 1041.3516, -1025.9297, 32.6719, 0.0, 0.0, 90.0);
CreateObject(-1003, -2716.3516, 217.4766, 5.3828, 0.0, 0.0, 0.0);
CreateObject(-1004, -1935.8594, 239.5313, 35.3516, 0.0, 0.0, 0.0);
CreateObject(-1005, 2386.6563, 1043.6016, 11.5938, 0.0, 0.0, 90.0);
// pay n sprays
AddSimpleModel(-1, 5422, -1006, "laespraydoor1.dff", "idlewood6_lae.txd");
AddSimpleModel(-1, 5856, -1007, "lawnspraydoor1.dff", "garag3_lawn.txd");
AddSimpleModel(-1, 6400, -1008, "spraydoor_law2.dff", "beafron2_law2.txd");
AddSimpleModel(-1, 11319, -1009, "sprayshpdr2_sfse.dff", "carshow_sfse.txd");
AddSimpleModel(-1, 9625, -1010, "spdr_sfw.dff", "garage_sfw.txd");
AddSimpleModel(-1, 7891, -1011, "vgwspry1.dff", "vegasbuild.txd");
AddSimpleModel(-1, 13028, -1012, "ce_spraydoor1.dff", "ce_payspray.txd");
AddSimpleModel(-1, 3294, -1013, "cxf_spraydoor1.dff", "cxrf_payspray.txd");
CreateObject(-1006, 2071.4766, -1831.4219, 14.5625, 0.0, 0.0, 0.0);
CreateObject(-1007, 1024.9844, -1029.3516, 33.1953, 0.0, 0.0, 90.0);
CreateObject(-1008, 488.2813, -1734.6953, 12.3906, 0.0, 0.0, 90.0);
CreateObject(-1009, -1904.5313, 277.8984, 42.9531, 0.0, 0.0, 0.0);
CreateObject(-1010, -2425.7266, 1027.9922, 52.2813, 0.0, 0.0, 90.0);
CreateObject(-1011, 1968.7422, 2162.4922, 12.0938, 0.0, 0.0, 0.0);
CreateObject(-1012, 720.0156, -462.5234, 16.8594, 0.0, 0.0, 90.0);
CreateObject(-1013, -1420.5469, 2591.1563, 57.7422, 0.0, 0.0, 90.0);
CreateObject(-1013, -100.0000, 1111.4141, 21.6406, 0.0, 0.0, 270.0);
// bomb shops
AddSimpleModel(-1, 5043, -1014, "bombdoor_las.dff", "shopliquor_las.txd");
CreateObject(-1014, 1843.3672, -1856.3203, 13.8750, 0.0, 0.0, 0.0);
CreateObject(-1014, 2006.0000, 2317.6016, 11.3125, 0.0, 0.0, 270.0);
CreateObject(-1014, 2006.0000, 2303.7266, 11.3125, 0.0, 0.0, 90.0);
I've attached all the required files and textures in a ZIP, which you'll need to extract to your models folder (wherever that may be).
If you're interested in editing the original LV bomb shop doors their names are "vgwbom1" and "vgwbom2" with TXD "vgnretail3"; however I genuinely wouldn't bother if I were you as the LS bomb shop door is identical in every way other than it is solid!
This method of closing doors can be used for any garage in the game - safe garages, burglary garages, you name it.. All you have to do is remove the original doors with RemoveBuildingForPlayer, find the DFF and TXD file (probably in gta3.img) , use AddSimpleModel to create a replica, and bob's your uncle.
Re: Disabling bomb shops in 0.3.8 -
Marllun - 04.12.2017
cool *-*
Re: Disabling bomb shops in 0.3.8 -
IllidanS4 - 05.12.2017
Fascinating. Why does this work?
Re: Disabling bomb shops in 0.3.8 -
ModGuy - 05.12.2017
Quote:
Originally Posted by sprtik
Fascinating. Why does this work?
|
It works because it's different object id. Game is searching for garage door object id.
Re: Disabling bomb shops in 0.3.8 -
Kar - 05.12.2017
Quote:
Originally Posted by sprtik
Fascinating. Why does this work?
|
AFAIK, the actual door is linked to the game. So when someone enters the bomb shop it attempts to find that door. If you recreate the door object, the game still finds it but the door doesn't have it's internal attributes because you removed it thus crashing.
I think.
Re: Disabling bomb shops in 0.3.8 -
ModGuy - 05.12.2017
Quote:
Originally Posted by Kar
AFAIK, the actual door is linked to the game. So when someone enters the bomb shop it attempts to find that door. If you recreate the door object, the game still finds it but the door doesn't have it's internal attributes because you removed it thus crashing.
I think.
|
Yep.
Re: Disabling bomb shops in 0.3.8 -
ZaikerH - 05.12.2017
I do not know the truth that contains different.
My game is never locked when you erase these doors.
But, good contribution, I suppose.
Re: Disabling bomb shops in 0.3.8 -
IllidanS4 - 05.12.2017
Nice poem.
Re: Disabling bomb shops in 0.3.8 -
Saddin - 06.12.2017
any similiar way to make same for pay n respray and modding garages?
Re: Disabling bomb shops in 0.3.8 -
niCe - 06.12.2017
Nice! It would be certainly better if the game script for bomb shops, spray shops and mod shops could be disabled (like it works with food and ammu scripts), so we could create our own scripts, it would also work better with anticheat.
Re: Disabling bomb shops in 0.3.8 -
adri1 - 06.12.2017
I will use for pay n spray and bomb shop, thank you
Re: Disabling bomb shops in 0.3.8 -
DavidGravelli - 06.12.2017
Nice.
Re: Disabling garages in 0.3.8 -
beckzy - 08.12.2017
I've edited the original post to include closed PayNSprays.
Re: Disabling bomb shops in 0.3.8 -
Romz - 08.12.2017
And why did not you remove the extra textures from the TXD files? This will greatly reduce their size, they will be more quickly downloaded.
Re: Disabling bomb shops in 0.3.8 -
beckzy - 08.12.2017
Quote:
Originally Posted by Romz
And why did not you remove the extra textures from the TXD files? This will greatly reduce their size, they will be more quickly downloaded.
|
You can do that yourself. I doubt it will change the download time drastically. The download dialog barely appears for me before disappearing upon completion. This topic is just to show examples of how the doors can be closed.
P.S. IDK what is wrong with the PayNSpray door in Doherty but the SA-MP client doesn't seem to like it. I thought maybe it was because the file name was too long (20 chars) , but I've since learned that that should be fine. Let me know if it works for you, or if it shows a question mark instead. All other PayNSpray doors work perfectly.
Re: Disabling bomb shops in 0.3.8 -
Romz - 08.12.2017
Some files occupy more than 1 megabyte, so removing superfluous textures would be very useful. I understand that any person who will use your method can remove them. I'm not going to use it, it was just an offer for you.
Re: Closing garages in 0.3.8 -
beckzy - 08.12.2017
I've added mod shops to the first post
Re: Closing garages in 0.3.8 -
RIDE2DAY - 08.12.2017
Such a nice trick, good job! You could even create an include with this.
I didn't try this yet, but do you know if moving the object server-side might cause any kind of warning/crash?
Best regards.
Re: Closing garages in 0.3.8 -
beckzy - 08.12.2017
Quote:
Originally Posted by RIDE2DAY
Such a nice trick, good job! You could even create an include with this.
I didn't try this yet, but do you know if moving the object server-side might cause any kind of warning/crash?
Best regards.
|
Moving the object should work fine, but using the garages with the original object removed will probably cause a crash.
Re: Closing garages in 0.3.8 -
DRIFT_HUNTER - 08.12.2017
Easiest way to handle garages would be to remove door object and just create our own in closed position...No need for any custom objects and downloads...