Raised This Month: $ Target: $400
 0% 

Findout if Player is on CT or T Base


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
XCoder
Member
Join Date: Mar 2006
Location: Worldwide
Old 03-26-2006 , 10:36   Findout if Player is on CT or T Base
Reply With Quote #1

Hello,

I have an simpel Problem with an Script.
I try to check via an "IF" if the player is on his OWN Base or on ENEMYS Base.

I tryd with if(cs_get_user_buyzone(id)>0), but this works only for own Buyzone, and if the Map didnt have an Buyzone... it want works...


So i need the Vars to check if the player is on own or enemy base..
Please help...


Thanks a lot.

XCoder
XCoder is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 03-26-2006 , 12:19  
Reply With Quote #2

There are no nice ways.
VEN is offline
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 03-26-2006 , 12:39  
Reply With Quote #3

Not a very helpful response, VEN.
Brad is offline
FatalisDK
Senior Member
Join Date: Mar 2006
Location: bacon
Old 03-26-2006 , 12:44  
Reply With Quote #4

Something like this should work. (more experienced coders can optimize this I bet)

Code:
new Float:origin[3] entity_get_vector(id, EV_VEC_origin, origin) new ent = find_entity_sphere(id, origin, 128.0) while(ent > 0) {     new classname[32]     entity_get_string(ent, EV_SZ_classname, classname, 31)     if(equal(classname, "info_player_start"))     {         //Player is near CT spawn     }     if(equal(classname, "info_player_deathmatch"))     {         //Player is near T spawn     }     ent = find_entity_sphere(ent, origin, 128.0) }
FatalisDK is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 03-26-2006 , 12:47  
Reply With Quote #5

Quote:
Not a very helpful response, VEN.
But he better know the truth.
Quote:
Player is near
That's what i mean.
VEN is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 03-26-2006 , 15:30  
Reply With Quote #6

Quote:
Originally Posted by FatalisDK
Something like this should work. (more experienced coders can optimize this I bet)
Slight optimization:
Code:
    new Float:vOrigin[3],szClassname[32],iEnt     entity_get_vector(id,EV_VEC_origin,vOrigin)     while((iEnt = find_ent_in_sphere(id,vOrigin,128.0)) != 0)     {         entity_get_string(iEnt,EV_SZ_classname,szClassname,31)                 if(equal(szClassname,"info_player_start"))         {             //Player is near CT spawn         }         else if(equal(szClassname,"info_player_deathmatch"))         {             //Player is near T spawn         }     }
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 03-26-2006 , 15:37  
Reply With Quote #7

That code tells you when you're near a spawn point but that doesn't necessarily mean you're in a buy zone.

Just wanted to make that clear in case being in the buyzone is what he's really after.
Brad is offline
XCoder
Member
Join Date: Mar 2006
Location: Worldwide
Old 03-27-2006 , 01:54  
Reply With Quote #8

um okay thanks verry much, but i dont understand what this makes

else if(equal(szClassname,"info_player_deathmatch" ))

What info_player_deathmatch means?
Is this normal for Terror Base?


Greets

XCoder
XCoder is offline
FatalisDK
Senior Member
Join Date: Mar 2006
Location: bacon
Old 03-27-2006 , 01:55  
Reply With Quote #9

Yes, it's a T spawn point.
FatalisDK is offline
XCoder
Member
Join Date: Mar 2006
Location: Worldwide
Old 03-27-2006 , 02:02  
Reply With Quote #10

Okay great...

Then should it work like i want it ...
I will try it out now!

Hope Server dont crash
XCoder is offline
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

Forum Jump


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


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