Raised This Month: $ Target: $400
 0% 

Problem with cs_get_user_buyzone(index)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 08-19-2009 , 19:19   Problem with cs_get_user_buyzone(index)
Reply With Quote #1

PHP Code:
#include <amxmodx>
#include <cstrike>

#define PLUGIN    "BuyZone Example"
#define AUTHOR    "Alucard"
#define VERSION    "1.0"

new p_BuyZone

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /buy""BuySomething")
    
    
p_BuyZone register_cvar("buy_zone""1")
}

public 
BuySomething(id)
{
    if(
get_pcvar_num(p_BuyZone) && !cs_get_user_buyzone(id) )
    {
        
client_print(idprint_chat"You need to be in a buyzone to buy something")
        return 
PLUGIN_HANDLED
    
}
    
client_print(idprint_chat"Take this!")
    return 
PLUGIN_HANDLED

Why dont work? o.o

I tried with "else"... i tried with "cs_get_user_buyzone(id) == 0" like other plugin... but is the same.

If i am in a buy zone i get this message:

Quote:
You need to be in a buyzone to buy something
If i am not in a buy zone i get the same message.
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
Old 08-19-2009, 19:39
crazyeffect
This message has been deleted by crazyeffect. Reason: Tuty does it better :D
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 08-19-2009 , 19:43   Re: Problem with cs_get_user_buyzone(index)
Reply With Quote #3

try

PHP Code:
 if( get_pcvar_num(p_BuyZone) == )
 {
        if( !
cs_get_user_buyzone(id))
        {
               
// blabla not in bz
        
}

__________________
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-19-2009 , 20:27   Re: Problem with cs_get_user_buyzone(index)
Reply With Quote #4

@tuty: it doesn't matter.

@Alucard^: You code works fine. Tested myself. Make sure you are really in a buyzone.
__________________
Arkshine is offline
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 08-22-2009 , 18:48   Re: Problem with cs_get_user_buyzone(index)
Reply With Quote #5

Quote:
Originally Posted by Arkshine View Post
@tuty: it doesn't matter.

@Alucard^: You code works fine. Tested myself. Make sure you are really in a buyzone.
i saw that lol
;/
__________________
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 08-20-2009 , 02:15   Re: Problem with cs_get_user_buyzone(index)
Reply With Quote #6

Solved, thx to all.
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
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 15:04.


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