Raised This Month: $ Target: $400
 0% 

this code not work


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Choose_Your_Destiny
Senior Member
Join Date: May 2011
Old 08-09-2013 , 12:30   this code not work
Reply With Quote #1

All admin have the ADMIN_LEVEL_H

Admin write "say /weapon".But, this is useless

PHP Code:
public item_selected(id)
{
    if(
is_user_alive(id) && get_user_flags(id) & ADMIN_LEVEL_H) {
        
ColorChat(idNORMAL,"^4[Biohazard]:^1 Buy to a ^3Cart Blue^1 gun should be ^4ADMIN^1!!")
        return 
PLUGIN_HANDLED
    
}
    new 
admin_name[32]
    
get_user_name(id,admin_name,31)

    new 
cash cs_get_user_money(id)

    if(
cash >= get_pcvar_num(cvar_cartblue_cash)) {
        
cs_set_user_money(idcash get_pcvar_num(cvar_cartblue_cash))
        
give_cartred(id)
        
ColorChat(id,NORMAL,"^4[Biohazard]:^1 ADMIN: %s You have purchased a ^4Cart Blue^1 gun.",admin_name)
    } else {
        
ColorChat(id,NORMAL,"^4[Biohazard]:^1 ADMIN: %s You don't have enough money! You need: %d $",admin_name,get_pcvar_num(cvar_cartblue_cash))
    }
    return 
PLUGIN_HANDLED


Last edited by Choose_Your_Destiny; 08-09-2013 at 12:30.
Choose_Your_Destiny is offline
akcaliberg
Senior Member
Join Date: Nov 2011
Location: Istanbul
Old 08-09-2013 , 13:53   Re: this code not work
Reply With Quote #2

PHP Code:
public item_selected(id)
{
    if( !(
get_user_flags(id) & ADMIN_LEVEL_H) ) {
        
ColorChat(idNORMAL,"^4[Biohazard]:^1 Buy to a ^3Cart Blue^1 gun should be ^4ADMIN^1!!")
        return 
PLUGIN_HANDLED
    
}
    if( !
is_user_alive(id) ) {
        
ColorChat(idNORMAL,"^4[Biohazard]:^1 You have to be alive!")
        return 
PLUGIN_HANDLED
    
}
    new 
admin_name[32]
    
get_user_name(id,admin_name,31)
    
    new 
cash cs_get_user_money(id)
    
    if(
cash >= get_pcvar_num(cvar_cartblue_cash)) {
        
cs_set_user_money(idcash get_pcvar_num(cvar_cartblue_cash))
        
give_cartred(id)
        
ColorChat(id,NORMAL,"^4[Biohazard]:^1 ADMIN: %s You have purchased a ^4Cart Blue^1 gun.",admin_name)
        } else {
        
ColorChat(id,NORMAL,"^4[Biohazard]:^1 ADMIN: %s You don't have enough money! You need: %d $",admin_name,get_pcvar_num(cvar_cartblue_cash))
    }
    return 
PLUGIN_HANDLED


Last edited by akcaliberg; 08-09-2013 at 13:55.
akcaliberg 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 15:53.


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