Raised This Month: $ Target: $400
 0% 

When Player is in Bomb Plant Zone & When Player is not in Bomb Plant Zone!!!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kketan77
Member
Join Date: Apr 2012
Location: India
Old 11-04-2013 , 04:00   When Player is in Bomb Plant Zone & When Player is not in Bomb Plant Zone!!!
Reply With Quote #1

This code detects player is in the bomb plant zone.

But, How do i check when player is not in Bomb Plant Zone?

PHP Code:
public plugin_init()
{
    
register_touch("func_bomb_target","player","touch_bombsite")
}

public 
touch_bombsite(ent,id)
{
    
client_print(idprint_chat"You are in Bomb Plant Zone!!!")
    
// Code while player is in Bomb Plant Zone

Thanks in Advance!
__________________
♚ || -=[ḰḝṮẫṊ]=- || ᕙ(`▽´)ᕗ || (⊙.⊙(☉_☉)⊙.⊙) || ⁀⊙﹏☉⁀

Last edited by kketan77; 11-10-2013 at 05:26.
kketan77 is offline
Send a message via Yahoo to kketan77
kketan77
Member
Join Date: Apr 2012
Location: India
Old 11-06-2013 , 08:47   Re: When Player is in Bomb Plant Zone & When Player is not in Bomb Plant Zone!!!
Reply With Quote #2

Solved! i used this code...
PHP Code:
public client_PostThink(id)
{
    if(
is_user_alive(id) && cs_get_user_bombtarget(id))
    {
        
// Code while player in func_bomb_target
    
}
    
    if(
is_user_alive(id) && !cs_get_user_bombtarget(id))
    {
        
// Code while player not in func_bomb_target
    
}
}

stock cs_get_user_bombtarget(index)
{
    new 
ent = -1, class[] = "func_bomb_target"
    
while ((ent fm_find_ent_by_class(ent, class)))
    {
        if (!
fm_boxents_distance(indexent))
            return 
1
    
}
    return 
0

__________________
♚ || -=[ḰḝṮẫṊ]=- || ᕙ(`▽´)ᕗ || (⊙.⊙(☉_☉)⊙.⊙) || ⁀⊙﹏☉⁀
kketan77 is offline
Send a message via Yahoo to kketan77
Old 11-06-2013, 09:01
Don_Collione
This message has been deleted by ConnorMcLeod. Reason: useless
joshknifer
Veteran Member
Join Date: Jun 2011
Location: Denver, CO
Old 11-06-2013 , 13:31   Re: [Solved!]When Player is in Bomb Plant Zone & When Player is not in Bomb Plant Zon
Reply With Quote #3

Quote:
Originally Posted by Don_Collione View Post
Bump
What are you bumping for first of all? The post before yours shows a solution? Also, just because it wasn't your post doesn't change the rules on bumping. Wait 14 days.
__________________
joshknifer is offline
Send a message via Skype™ to joshknifer
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 11-06-2013 , 17:47   Re: When Player is in Bomb Plant Zone & When Player is not in Bomb Plant Zone!!!
Reply With Quote #4

Quote:
Originally Posted by kketan77 View Post
Solved! i used this code...
PHP Code:
public client_PostThink(id)
{
    if(
is_user_alive(id) && cs_get_user_bombtarget(id))
    {
        
// Code while player in func_bomb_target
    
}
    
    if(
is_user_alive(id) && !cs_get_user_bombtarget(id))
    {
        
// Code while player not in func_bomb_target
    
}
}

stock cs_get_user_bombtarget(index)
{
    new 
ent = -1, class[] = "func_bomb_target"
    
while ((ent fm_find_ent_by_class(ent, class)))
    {
        if (!
fm_boxents_distance(indexent))
            return 
1
    
}
    return 
0

That is a crap, don't use it
__________________
alan_el_more is offline
kketan77
Member
Join Date: Apr 2012
Location: India
Old 11-10-2013 , 05:27   Re: When Player is in Bomb Plant Zone & When Player is not in Bomb Plant Zone!!!
Reply With Quote #5

Do you have any other good way to do this?
__________________
♚ || -=[ḰḝṮẫṊ]=- || ᕙ(`▽´)ᕗ || (⊙.⊙(☉_☉)⊙.⊙) || ⁀⊙﹏☉⁀
kketan77 is offline
Send a message via Yahoo to kketan77
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-10-2013 , 05:34   Re: When Player is in Bomb Plant Zone & When Player is not in Bomb Plant Zone!!!
Reply With Quote #6

For what do you need this ?
Do you need it for all players or for bomber ?
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
kketan77
Member
Join Date: Apr 2012
Location: India
Old 11-10-2013 , 05:40   Re: When Player is in Bomb Plant Zone & When Player is not in Bomb Plant Zone!!!
Reply With Quote #7

I want this for some kind of function which works only within func_bomb_target area!

I want it only for Terrorist, till the bomb plant.
__________________
♚ || -=[ḰḝṮẫṊ]=- || ᕙ(`▽´)ᕗ || (⊙.⊙(☉_☉)⊙.⊙) || ⁀⊙﹏☉⁀
kketan77 is offline
Send a message via Yahoo to kketan77
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-10-2013 , 05:48   Re: When Player is in Bomb Plant Zone & When Player is not in Bomb Plant Zone!!!
Reply With Quote #8

What kind ?

Explain exactly what you want to do please.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
kketan77
Member
Join Date: Apr 2012
Location: India
Old 11-10-2013 , 05:57   Re: When Player is in Bomb Plant Zone & When Player is not in Bomb Plant Zone!!!
Reply With Quote #9

Sure! Why not!!!

I giving C4 to all Terrorist. All Terrorist get striped from C4 when any Terrorist successful to plant C4.
Also i am making function like, Press & Hold 'E' Button to Plant C4.(same as CS:GO style)

This function enable while Terrorist is standing with in the func_bomb_target. If he is not standing with in func_bomb_target then disable this function.

Here all am trying to do!!
__________________
♚ || -=[ḰḝṮẫṊ]=- || ᕙ(`▽´)ᕗ || (⊙.⊙(☉_☉)⊙.⊙) || ⁀⊙﹏☉⁀

Last edited by kketan77; 11-10-2013 at 06:01.
kketan77 is offline
Send a message via Yahoo to kketan77
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-10-2013 , 06:07   Re: When Player is in Bomb Plant Zone & When Player is not in Bomb Plant Zone!!!
Reply With Quote #10

So, you want this :

1. All terrorists have a bomb at new round
2. Terrorists can plant bomb only if the press 'E' + 'mouse1'
3. When 1 terrorist has planted his bomb, all other bombs are stripped ?

That's all ?
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
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 00:34.


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