SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Maps

Reply
 
Thread Tools Display Modes
Old 18/01/2015, 02:22 AM   #1
Crayder
High-roller
 
Crayder's Avatar
 
Join Date: Sep 2013
Location: Flames of Hell
Posts: 3,862
Reputation: 591
Default Blocking Garages Realistically (well, something like that)

REALISTICALLY BLOCK GARAGES!

Description:
Umm, as the title says. These objects will make the garages unenterable, and it's better than most servers. An average server would block the garages with ugly gates that are very unrealistic considering the garage doors will close on top of it. I mean really, if your server is a roleplay server, why do something that unrealistic? Well check this out! Players can now try to drive into the garage because they think they can, when they get to the door it will open normally. What will they see when it opens? Nothing. That's right, NOTHING! So they will then try to drive into the garage (or walk) and it will not be possible. Conclusion: It looks realistic because it looks just like a regular garage.

Now it is all included in a more advanced include! Now you can add floating text on the garage entrance and block only certain garages!

Screenshots:
I don't really see any reason to post a screenshot but here you go!

Code:
EDIT: Code no longer needed. Check "Updates" section.

Updates:
Quote:
Update 1.01 [Jan 18, 15]
  • Converted to include.
  • Added BlockGarages(bool:block=true, GarageType:type=GARAGE_TYPE_ALL, text[]="") function.

    Types:
    Code:
    GARAGE_TYPE_ALL
    GARAGE_TYPE_PAINT
    GARAGE_TYPE_BOMB
    GARAGE_TYPE_MODSHOP
    Usage:
    Code:
    BlockGarages(); //Blocks garages of all types with no text.
    BlockGarages(false); //Unblocks all garages.
    BlockGarages(false, GARAGE_TYPE_PAINT); //Unblocks only Pay 'N Spray garages.
    BlockGarages(.text="DISABLED"); //Blocks all types of garages, and adds floating text to the garage entrance.
    BlockGarages(.type=GARAGE_TYPE_PAINT); //Blocks only Pay 'N Spray garages.
    BlockGarages(true, GARAGE_TYPE_MODSHOP, "MOD SHOPS\nARE DISABLED"); //Blocks all modshops, with floating text at the garage entrance.
Bugs:
  • Not sure if I've missed any garages, but this does not look like all of them. Please report any missing!
    Ps. I may go through the IPL files again to make sure I get them all.

Downloads:
GitHub
__________________
Those who deserve reputation, do not need to beg for it.
Also, don't expect the help you need when offering reputation, you'll just be attracting Rep Hunters.
Join SA-MP Discord!

Last edited by Crayder; 01/03/2016 at 05:27 AM.
Crayder is offline   Reply With Quote
Old 18/01/2015, 02:39 AM   #2
Abagail
High-roller
 
Join Date: Dec 2013
Location: GetPlayerPos(playerid, pos); Scripter/Mapper.
Posts: 3,517
Reputation: 437
Default Re: Blocking Garages Realistically (well, something like that)/

Looks alright, but maybe make this as an include, and make functions such as BlockGarage(Float: x, Float: y, Float: z, Float: rx = 0.0, Float: ry = 0.0, Float: rz = 0.0).

Or atleast just something like this:

Code:
BlockGarage(garageid=GARAGE_TYPE_ALL, bool: block);

Code:
#define GARAGE_TYPE_ALL   1
#define GARAGE_TYPE_PNS  2
#define GARAGE_TYPE_BOMB 3
#define GARAGE_TYPE_PLAYER 4
#define GARAGE_TYPE_MODSHOP 5

And maybe even
Code:
OnPlayerAttemptEnterGarage(playerid, garageid);
Abagail is offline   Reply With Quote
Old 18/01/2015, 03:50 AM   #3
LadyNyuuu
Little Clucker
 
LadyNyuuu's Avatar
 
Join Date: Nov 2011
Location: Germany
Posts: 31
Reputation: 2
Default AW: Blocking Garages Realistically (well, something like that)/

great idea and thanks for releasing it.

i see one problem with invisible objects, there will be much reports about "hey, i found a bug!".
whats about to put a text in front of the entry what says "DISABLED" ?
in combination with the post from Abagail you can let the scripter choose what he want to say as a disable text. :3
LadyNyuuu is offline   Reply With Quote
Old 18/01/2015, 04:03 AM   #4
Crayder
High-roller
 
Crayder's Avatar
 
Join Date: Sep 2013
Location: Flames of Hell
Posts: 3,862
Reputation: 591
Default Re: Blocking Garages Realistically (well, something like that)/

Actually guys I already have an include for this on pastebin, I took the objects from it and put them here. The only two functions were BlockGarages and UnblockGarages.

For proof look at the date of it. :P

http://pastebin.com/R86jr2zT





Anyways, thanks for the suggestion Abagail. I think it's a very good idea and I am going to do it tomorrow. And LadyNyuuu I was also thinking of adding text to them when I was reading Abagails suggestion. I think that will definitely come along with the include!





@Abagail: I'm considering the attempt to enter thing, how do you suggest I go about detecting the collision? Something like ColAndreas would make this easy, but ofc that is not released.





EDIT: Just finished, scripted it all (except the onplayerattempbleh thing) on my ipad and I can't test until tomorrow.
__________________
Those who deserve reputation, do not need to beg for it.
Also, don't expect the help you need when offering reputation, you'll just be attracting Rep Hunters.
Join SA-MP Discord!

Last edited by Crayder; 18/01/2015 at 05:08 AM.
Crayder is offline   Reply With Quote
Old 18/01/2015, 10:31 AM   #5
Crayder
High-roller
 
Crayder's Avatar
 
Join Date: Sep 2013
Location: Flames of Hell
Posts: 3,862
Reputation: 591
Default Re: Blocking Garages Realistically (well, something like that)/

Quote:
Originally Posted by Crayder View Post
Actually guys I already have an include for this on pastebin, I took the objects from it and put them here. The only two functions were BlockGarages and UnblockGarages.
For proof look at the date of it. :P
http://pastebin.com/R86jr2zT
Anyways, thanks for the suggestion Abagail. I think it's a very good idea and I am going to do it tomorrow. And LadyNyuuu I was also thinking of adding text to them when I was reading Abagails suggestion. I think that will definitely come along with the include!
@Abagail: I'm considering the attempt to enter thing, how do you suggest I go about detecting the collision? Something like ColAndreas would make this easy, but ofc that is not released.
EDIT: Just finished, scripted it all (except the onplayerattempbleh thing) on my ipad and I can't test until tomorrow.
Added include.

@Beta Testers and etc: Please set thread tag to [Include], and change title to "Realistically Block Garages!".
__________________
Those who deserve reputation, do not need to beg for it.
Also, don't expect the help you need when offering reputation, you'll just be attracting Rep Hunters.
Join SA-MP Discord!
Crayder is offline   Reply With Quote
Old 18/01/2015, 03:00 PM   #6
Abagail
High-roller
 
Join Date: Dec 2013
Location: GetPlayerPos(playerid, pos); Scripter/Mapper.
Posts: 3,517
Reputation: 437
Default Re: Blocking Garages Realistically (well, something like that)/

Quote:
Originally Posted by Crayder View Post
Actually guys I already have an include for this on pastebin, I took the objects from it and put them here. The only two functions were BlockGarages and UnblockGarages.

For proof look at the date of it. :P

http://pastebin.com/R86jr2zT





Anyways, thanks for the suggestion Abagail. I think it's a very good idea and I am going to do it tomorrow. And LadyNyuuu I was also thinking of adding text to them when I was reading Abagails suggestion. I think that will definitely come along with the include!





@Abagail: I'm considering the attempt to enter thing, how do you suggest I go about detecting the collision? Something like ColAndreas would make this easy, but ofc that is not released.





EDIT: Just finished, scripted it all (except the onplayerattempbleh thing) on my ipad and I can't test until tomorrow.
You can detect if the vehicle / player is considerably close(maybe a range of 1.25). As for the OnPlayerAttemptEnter: - the same goes: if they are very close, it'd be accurate enough(somewhere near 0.5 for onfoot players, and around 1.25 for players in a vehicle).
Abagail is offline   Reply With Quote
Old 18/01/2015, 03:03 PM   #7
Alex Magaņa
High-roller
 
Alex Magaņa's Avatar
 
Join Date: Oct 2012
Location: 𝕭𝖗𝖔𝖙𝖍𝖊𝖗𝖍𝖔𝖔𝖉
Posts: 2,447
Reputation: 211
Default Re: Blocking Garages Realistically (well, something like that)/

Good job useful!
__________________
Alex Magaņa is offline   Reply With Quote
Old 18/01/2015, 04:19 PM   #8
Crayder
High-roller
 
Crayder's Avatar
 
Join Date: Sep 2013
Location: Flames of Hell
Posts: 3,862
Reputation: 591
Default Re: Blocking Garages Realistically (well, something like that)/

Quote:
Originally Posted by Abagail View Post
You can detect if the vehicle / player is considerably close(maybe a range of 1.25). As for the OnPlayerAttemptEnter: - the same goes: if they are very close, it'd be accurate enough(somewhere near 0.5 for onfoot players, and around 1.25 for players in a vehicle).
So a good way would be OnVehicleDamageStatusUpdate, Take range, if near any door they attempted entering. That's what I was thinking.


EDIT: Well, I can't hook OnVehicleDamageStatusUpdate with any ALS method. y_hooks compiles with no errors, but everything in the hooked OnVehicleDamageStatusUpdate is never called. Debugging.
__________________
Those who deserve reputation, do not need to beg for it.
Also, don't expect the help you need when offering reputation, you'll just be attracting Rep Hunters.
Join SA-MP Discord!

Last edited by Crayder; 18/01/2015 at 05:49 PM.
Crayder is offline   Reply With Quote
Old 19/01/2015, 09:47 PM   #9
mitchellfunny1069
Big Clucker
 
Join Date: Mar 2010
Posts: 54
Reputation: 1
Default Re: Blocking Garages Realistically (well, something like that)/

Not that bad. Good job
mitchellfunny1069 is offline   Reply With Quote
Old 17/07/2015, 02:39 AM   #10
SWAT4
Huge Clucker
 
SWAT4's Avatar
 
Join Date: May 2014
Posts: 264
Reputation: 56
Default Re: Blocking Garages Realistically (well, something like that)/

i love it
SWAT4 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
[Include] Useful object streamer that streams objects realistically (the bigger the object, the farther it gets streamed from) RajatPawar Includes 28 13/10/2016 11:28 AM
GivePlayerCash - On Mod garages. CharlieSanchez Scripting Help 7 22/04/2014 03:51 PM
Business and Garages FaZeRs Scripting Help 3 06/02/2013 02:52 PM
Gate/garages nickstar Scripting Help 0 04/01/2013 08:53 PM
Disable garages Diorturato Scripting Help 4 28/12/2012 04:49 PM


All times are GMT. The time now is 09:57 AM.


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