Raised This Month: $ Target: $400
 0% 

Scripting Help.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
InfernaL29
Junior Member
Join Date: Nov 2008
Old 12-28-2009 , 19:10   Scripting Help.
Reply With Quote #1

So look, im coding a hns shop and i can't get the awp to work for Ts only.

PHP Code:
case 6// AWP
        
{
            if (
is_user_alive(id) && get_user_team(id) == && !userawp[id]) {
                
ColorChat(idBLUE"^x04%s^x01 You need to be alive!"PREFIX);
                return 
PLUGIN_HANDLED;
            }
            else
            {
                if ( 
get_user_team(id) == 1)
                {
                    
ColorChat(idBLUE"^x04%s^x01 You can only buy AWP once a round!"PREFIX);
                }
                if ( 
get_user_team(id) == 2)
                {
                    
ColorChat (idBLUE"^x04%s^x01 You cannot buy AWP because you are CT!"PREFIX);
                }
                if(
userawp[id] > 0) {
                    
ColorChat(idBLUE"^x04%s^x01 You already own this item!"PREFIX);
                    return 
PLUGIN_HANDLED;
                }
                if(
get_pcvar_num(allowawp) == 0) {
                    
ColorChat(idBLUE"^x04%s^x01 This item is disabled."PREFIX);
                    return 
PLUGIN_HANDLED;
                }
    
                new 
money fm_get_user_money(id);
                new 
cost get_pcvar_num(awpcost);
            
                if(
money cost || money == cost) {
                    
fm_set_user_money(idmoney cost);
                    
fm_give_item(id"weapon_awp");
                    
cs_set_weapon_ammo(find_ent_by_owner(1"weapon_awp"id), 1);
                    
userawp[id] = true;
                    
ColorChat(idBLUE"^x04%s^x01 You purchased an^x03 AWP."PREFIX);
                } 
                else
                {
                    
ColorChat(idBLUE"^x04%s^x01 You need more^x04 money^x01 to buy this!"PREFIX);
                }
            }
        } 
If anyone can help me make this work for Ts only, I will appreciate it. Thanks
InfernaL29 is offline
 



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 04:13.


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