Raised This Month: $ Target: $400
 0% 

Scripting Help.


Post New Thread Reply   
 
Thread Tools Display Modes
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
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-28-2009 , 22:00   Re: Scripting Help.
Reply With Quote #2

You could disable that option in the menu if the person is not on the right team.
__________________
fysiks is offline
InfernaL29
Junior Member
Join Date: Nov 2008
Old 12-29-2009 , 23:13   Re: Scripting Help.
Reply With Quote #3

didnt think about it. thanks for the idea
InfernaL29 is offline
Toastt
BANNED
Join Date: Nov 2009
Old 12-29-2009 , 23:37   Re: Scripting Help.
Reply With Quote #4

Quote:
Originally Posted by fysiks View Post
You could disable that option in the menu if the person is not on the right team.
smart.
Toastt is offline
shuttle_wave
Veteran Member
Join Date: Apr 2009
Location: New Zealand
Old 12-30-2009 , 00:37   Re: Scripting Help.
Reply With Quote #5

Next time make the title of the topic related to you help needed
__________________
JailBreak Mod with Plugin API ( 90% ) Public
shuttle_wave is offline
InfernaL29
Junior Member
Join Date: Nov 2008
Old 12-31-2009 , 11:47   Re: Scripting Help.
Reply With Quote #6

Quote:
Originally Posted by shuttle_wave View Post
Next time make the title of the topic related to you help needed
ok, sorry
InfernaL29 is offline
Toastt
BANNED
Join Date: Nov 2009
Old 12-31-2009 , 13:46   Re: Scripting Help.
Reply With Quote #7

Quote:
Originally Posted by InfernaL29 View Post
ok, sorry
no need to apologize , now you know for next time
Toastt is offline
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 04:13.


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