AlliedModders

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

InfernaL29 12-28-2009 19:10

Scripting Help.
 
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

fysiks 12-28-2009 22:00

Re: Scripting Help.
 
You could disable that option in the menu if the person is not on the right team.

InfernaL29 12-29-2009 23:13

Re: Scripting Help.
 
didnt think about it. thanks for the idea

Toastt 12-29-2009 23:37

Re: Scripting Help.
 
Quote:

Originally Posted by fysiks (Post 1034767)
You could disable that option in the menu if the person is not on the right team.

smart.

shuttle_wave 12-30-2009 00:37

Re: Scripting Help.
 
Next time make the title of the topic related to you help needed

InfernaL29 12-31-2009 11:47

Re: Scripting Help.
 
Quote:

Originally Posted by shuttle_wave (Post 1036103)
Next time make the title of the topic related to you help needed

ok, sorry

Toastt 12-31-2009 13:46

Re: Scripting Help.
 
Quote:

Originally Posted by InfernaL29 (Post 1037822)
ok, sorry

no need to apologize , now you know for next time :wink:


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

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