Raised This Month: $ Target: $400
 0% 

Check if a user is in a bombsite?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 05-25-2006 , 16:23   Check if a user is in a bombsite?
Reply With Quote #1

Umm..cant find it in functions...how would I do this?
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 05-25-2006 , 17:27  
Reply With Quote #2

You can try cs_get_user_plant.

Also, if that doesn't work, you can find all bombsites and just check in PreThink if they're anywhere near the site, in a certain radius.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 05-25-2006 , 17:32  
Reply With Quote #3

But thats the point...I dont want it when they are planting...I want it when they are in the site.
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 05-25-2006 , 17:39  
Reply With Quote #4

Quote:
Originally Posted by SweatyBanana
But thats the point...I dont want it when they are planting...I want it when they are in the site.
If you actually read the function instead of blindly claiming that I'm wrong, you would see that it checks if they are capable of planting. I don't know if it takes into account whether they have the bomb or not.

You can also hook StatusIcon, I just don't remember the parameters for the bomb icon.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 05-25-2006 , 17:47  
Reply With Quote #5

Oooooo..

See what I thought that function was saying is if they were a terrorist with the bomb...


Not that they could plant the bomb in that spot.
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 05-25-2006 , 17:48  
Reply With Quote #6

Quote:
Originally Posted by SweatyBanana
Oooooo..

See what I thought that function was saying is if they were a terrorist with the bomb...


Not that they could plant the bomb in that spot.
Whatever, worst case scenario is that you have to search around the player for the bombsite. Just use find_sphere_class every client frame or whatever, and check if there's a bomb entity around.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 05-25-2006 , 17:49  
Reply With Quote #7

Quote:
Whatever, worst case scenario is that you have to search around the player for the bombsite. Just use find_ent_sphere every client frame or whatever, and check if there's a bomb entity around.
Checking every client frame causes lag... Ive been reading through the includes
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 05-25-2006 , 17:50  
Reply With Quote #8

Quote:
Originally Posted by SweatyBanana
Quote:
Whatever, worst case scenario is that you have to search around the player for the bombsite. Just use find_ent_sphere every client frame or whatever, and check if there's a bomb entity around.
Checking every client frame causes lag... Ive been reading through the includes
No, it doesn't. You'd be surprised how much is done in client_PreThink on the game mod level. Very resource intensive stuff should be kept out of there, but I think this should cause no problems.

EDIT: You can even do it outside of client_PreThink. Just don't use a set_task, client_PreThink is actually less resource intensive.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Kraugh
Senior Member
Join Date: Jan 2006
Location: barrington, ri
Old 05-26-2006 , 03:01  
Reply With Quote #9

players and bombsites are both rectangular, sphere calculations won't always work accurately in this instance.
__________________
"You can not restrain a fool from speaking, but nothing obliges you to listen."
Kraugh is offline
Send a message via AIM to Kraugh
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 05-26-2006 , 08:15  
Reply With Quote #10

Quote:
Originally Posted by Kraugh
players and bombsites are both rectangular, sphere calculations won't always work accurately in this instance.
I don't think he needs to know if they're exactly in the bombsite, just somewhere around it.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
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 16:21.


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