AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Problem with cs_get_user_buyzone(index) (https://forums.alliedmods.net/showthread.php?t=100992)

Alucard^ 08-19-2009 19:19

Problem with cs_get_user_buyzone(index)
 
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.

tuty 08-19-2009 19:43

Re: Problem with cs_get_user_buyzone(index)
 
try :arrow:

PHP Code:

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



Arkshine 08-19-2009 20:27

Re: Problem with cs_get_user_buyzone(index)
 
@tuty: it doesn't matter.

@Alucard^: You code works fine. Tested myself. Make sure you are really in a buyzone.

Alucard^ 08-20-2009 02:15

Re: Problem with cs_get_user_buyzone(index)
 
Solved, thx to all.

tuty 08-22-2009 18:48

Re: Problem with cs_get_user_buyzone(index)
 
Quote:

Originally Posted by Arkshine (Post 906123)
@tuty: it doesn't matter.

@Alucard^: You code works fine. Tested myself. Make sure you are really in a buyzone.

i saw that lol
;/


All times are GMT -4. The time now is 15:04.

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