Raised This Month: $51 Target: $400
 12% 

Detection of spawn proximity


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 04-12-2016 , 18:02   Detection of spawn proximity
Reply With Quote #1

In what way we can detect whether the player close to the spawn,ct and ts?
Krtola is offline
Send a message via Skype™ to Krtola
Depresie
Veteran Member
Join Date: Nov 2013
Old 04-12-2016 , 18:45   Re: Detection of spawn proximity
Reply With Quote #2

Yes, sure it is, idk how exactly, but the spawn points are entities, you just have to find out their class
You will probably need a prethink to check when the player is close to them

Or, maybe create an entity with a large radius ( a zone ) at the origin of the spawn points and then check if the player is in that zone with Ham_Touch...

Unfortenately im not experienced enough to do something like this, but im sure it's not much fuss, you could post a req in the request section, im sure an experienced scripter could do this in couple minutes
__________________
Depresie is offline
PartialCloning
Senior Member
Join Date: Dec 2015
Old 04-12-2016 , 22:12   Re: Detection of spawn proximity
Reply With Quote #3

Personally I'd hook buyzone touch.
PartialCloning is offline
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 04-13-2016 , 03:28   Re: Detection of spawn proximity
Reply With Quote #4

I need that for lasermines.
If you are to close to the spawn,you will not be able to set lasermine etc..
Will continue to search and will try wyth buyzone.
Krtola is offline
Send a message via Skype™ to Krtola
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 04-13-2016 , 08:39   Re: Detection of spawn proximity
Reply With Quote #5

I found this:
PHP Code:
cs_get_user_buyzone(id
But with this function we have problem:

CT(survivors) players can not plant on CT spawn,but can plant on TS spawn.
TS(zombies) players can not plant on TS spawn,but can plant on CT spawn.
Krtola is offline
Send a message via Skype™ to Krtola
PartialCloning
Senior Member
Join Date: Dec 2015
Old 04-13-2016 , 11:03   Re: Detection of spawn proximity
Reply With Quote #6

That's not what I said.

Try:
PHP Code:
RegisterHam(Ham_Touch"func_buyzone""yourfunction"); 
On plugin_init scan for buyzones, within a small radius look for info_player_start, if you can find it mark that buyzone as CT spawn, if not look for info_player_deathmatch, if you find it mark that buyzone as a Terr spawn, otherwise you need to check the map to see if the mapper placed the buyzone out of reach.
PartialCloning is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 04-13-2016 , 12:58   Re: Detection of spawn proximity
Reply With Quote #7

There are maps without buyzone. In this case you shall use find_ent_by_class cand check distance to every spawn entity and compare it to a predefined distance with #define or by cvar so it will be easy for you to change it whenever you want.

But if you don't give a freak about buyzoneless then you can use touch above.
siriusmd99 is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 04-13-2016 , 13:12   Re: Detection of spawn proximity
Reply With Quote #8

Btw if you need that for the lasermines to not kill spawning players, you can forget about it, because you can set it far away from the spawn zone and the laser will reach the spawn zone
__________________
Depresie is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 04-13-2016 , 16:45   Re: Detection of spawn proximity
Reply With Quote #9

Quote:
Originally Posted by Depresie View Post
Btw if you need that for the lasermines to not kill spawning players, you can forget about it, because you can set it far away from the spawn zone and the laser will reach the spawn zone
lol, thats why it's better when user explains what he tries to acomplish.
siriusmd99 is offline
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 04-13-2016 , 17:33   Re: Detection of spawn proximity
Reply With Quote #10

Quote:
Originally Posted by Depresie View Post
Btw if you need that for the lasermines to not kill spawning players, you can forget about it, because you can set it far away from the spawn zone and the laser will reach the spawn zone
Thank you all.
This give me new idea: no damage for zombies if they are on the buy zone(and usually it is also a spawn position).
Problem solved.

Last edited by Krtola; 04-13-2016 at 17:34.
Krtola is offline
Send a message via Skype™ to Krtola
Reply



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

Forum Jump


All times are GMT -4. The time now is 03:45.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode