SA-MP Forums

Go Back   SA-MP Forums > SA-MP DL Edition > SA-MP 0.3.DL

Reply
 
Thread Tools Display Modes
Old 04/12/2017, 05:09 PM   #1
BeckzyBoi
Beta Tester
 
Join Date: Dec 2006
Posts: 1,191
Reputation: 135
Default Closing garages in 0.3.8

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.
Attached Files
File Type: zip garagedoors.zip (4.75 MB, 87 views)

Last edited by BeckzyBoi; 08/12/2017 at 02:20 PM.
BeckzyBoi is offline   Reply With Quote
Old 04/12/2017, 05:16 PM   #2
Marllun
Gangsta
 
Marllun's Avatar
 
Join Date: Oct 2016
Location: Brazil
Posts: 886
Reputation: 32
Default Re: Disabling bomb shops in 0.3.8

cool *-*
__________________
Code:
Discord: Marllun#6297
Marllun is offline   Reply With Quote
Old 05/12/2017, 12:18 AM   #3
IllidanS4
Huge Clucker
 
IllidanS4's Avatar
 
Join Date: Feb 2013
Posts: 336
Reputation: 255
Default Re: Disabling bomb shops in 0.3.8

Fascinating. Why does this work?
__________________
PawnPlus
YSF
Yet Another Lua Plugin
Long Function Names
 i_quat.inc 


kingsofsa.cz:8888 running Cinematic Mode
IllidanS4 is offline   Reply With Quote
Old 05/12/2017, 12:45 AM   #4
ModGuy
Banned
 
Join Date: Nov 2017
Posts: 14
Reputation: 0
Default Re: Disabling bomb shops in 0.3.8

Quote:
Originally Posted by sprtik View Post
Fascinating. Why does this work?
It works because it's different object id. Game is searching for garage door object id.
ModGuy is offline   Reply With Quote
Old 05/12/2017, 12:49 AM   #5
Kar
Banned
 
Join Date: May 2010
Location: Black Asylum
Posts: 2,993
Reputation: 538
Default Re: Disabling bomb shops in 0.3.8

Quote:
Originally Posted by sprtik View Post
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.
Kar is offline   Reply With Quote
Old 05/12/2017, 01:20 AM   #6
ModGuy
Banned
 
Join Date: Nov 2017
Posts: 14
Reputation: 0
Default Re: Disabling bomb shops in 0.3.8

Quote:
Originally Posted by Kar View Post
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.
ModGuy is offline   Reply With Quote
Old 05/12/2017, 01:41 AM   #7
ZaikerH
Banned
 
Join Date: May 2017
Posts: 177
Reputation: 43
Default Re: Disabling bomb shops in 0.3.8

I do not know the truth that contains different.
My game is never locked when you erase these doors.

But, good contribution, I suppose.
ZaikerH is offline   Reply With Quote
Old 05/12/2017, 10:48 PM   #8
IllidanS4
Huge Clucker
 
IllidanS4's Avatar
 
Join Date: Feb 2013
Posts: 336
Reputation: 255
Default Re: Disabling bomb shops in 0.3.8

Quote:
Originally Posted by ZaikerH View Post
I do not know the truth that contains different.
My game is never locked when you erase these doors.

But, good contribution, I suppose.
Nice poem.
__________________
PawnPlus
YSF
Yet Another Lua Plugin
Long Function Names
 i_quat.inc 


kingsofsa.cz:8888 running Cinematic Mode
IllidanS4 is offline   Reply With Quote
Old 06/12/2017, 07:22 PM   #9
Saddin
Huge Clucker
 
Saddin's Avatar
 
Join Date: Mar 2011
Posts: 371
Reputation: 35
Default Re: Disabling bomb shops in 0.3.8

any similiar way to make same for pay n respray and modding garages?
Saddin is offline   Reply With Quote
Old 06/12/2017, 07:48 PM   #10
niCe
Huge Clucker
 
niCe's Avatar
 
Join Date: Mar 2008
Location: CZ
Posts: 331
Reputation: 371
Default Re: Disabling bomb shops in 0.3.8

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.
__________________
[ENG] s2.gta-multiplayer.cz:7777 WTLS 2 (Singleplayer Features)
[ENG] s3.gta-multiplayer.cz:7777 WTLS 3 (Singleplayer Features)

- Many features from singleplayer
- Pool, basketball and Poker Texas Holdem minigames, singleplayer race and other challenges
- Video game QUB3D from GTA 4
- Roulettes, blackjack, slot machines, video poker and horse-betting
- Stock market BAWSAQ from GTA 5
- Phone with a lot of features from GTA Online
- Missions from Big Smoke, Sweet, Zero, Cesar or Woozie!
- Gang wars over 100 gang hoods
- More than 30 jobs (police, paramedic, firefighter, burglar, pimp, valet pizza-boy and more)
- Gyms, strip clubs, clothes shops, hidden packages, oysters, spray tags, horseshoes and more
VIDEO
niCe is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tune Garages Rodri99 Scripting Help 0 16/06/2015 07:32 PM
[Map] SF Villa/with Bar/and Garages NexySamp Maps 0 25/05/2015 08:27 PM
Business and Garages FaZeRs Scripting Help 3 06/02/2013 02:52 PM
Disable garages Diorturato Scripting Help 4 28/12/2012 04:49 PM
Garages not loading? rep RLGaming Scripting Help 3 13/10/2012 06:57 PM


All times are GMT. The time now is 06:40 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.