Raised This Month: $32 Target: $400
 8% 

Help vip flag


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
LifeStone
Member
Join Date: Oct 2015
Old 03-20-2017 , 04:35   Help vip flag
Reply With Quote #1

Hello guys i want to make that to take it only vips i used that but does not work anyone can help ?
PHP Code:
            if (get_user_flagsid ) ) & ADMIN_LEVEL_H ) {
                
ColorChatidNORMAL,"You need to be VIP to buy this item");
                return 
PLUGIN_HANDLED
            } 
Code:
        case 1:
        {
            if (get_user_flags( id ) ) & ADMIN_LEVEL_H ) {
                ColorChat( id, NORMAL,"You need to be VIP to buy this item");
                return PLUGIN_HANDLED; 
            }
            if( !is_user_alive( id ) ) {
                ColorChat( id, NORMAL,"You can not buy items if you are dead");
                return PLUGIN_HANDLED; 
            }
            if(userm3[id] > 0) {
                ColorChat( id, NORMAL, "You have already buy this item before");
                return PLUGIN_HANDLED;
            }
            if( bm_points[id] >= 30 ) {
                bm_points[id] -= 30
                fm_give_item( id, "weapon_m3" )
                cs_set_weapon_ammo( find_ent_by_owner( 1, "weapon_m3", id ), 1 )
                cs_set_user_bpammo(id, CSW_M3, 0)
                new m3name[42]
                get_user_name(id, m3name, 32)
                userm3[id]++;
                new szName[33];
                get_user_name(id, szName, 32);
                ColorChat( 0, NORMAL, "%s bought M3", szName )
                } else {
                ColorChat( id, NORMAL, "You need more points to buy M3")
            }
        }

Last edited by LifeStone; 03-20-2017 at 04:36.
LifeStone is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 03-20-2017 , 07:12   Re: Help vip flag
Reply With Quote #2

Whats ur vip flag ?
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Airkish
AlliedModders Donor
Join Date: Apr 2016
Location: Lithuania
Old 03-20-2017 , 07:16   Re: Help vip flag
Reply With Quote #3

PHP Code:
if (!(get_user_flagsid )  & ADMIN_LEVEL_H) ) {
                
ColorChatidNORMAL,"You need to be VIP to buy this item");
                return 
PLUGIN_HANDLED
            } 
__________________

Last edited by Airkish; 03-20-2017 at 07:59.
Airkish is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 03-20-2017 , 07:21   Re: Help vip flag
Reply With Quote #4

Wasn't hard was it?

Mark it as solved
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 03-20-2017 at 07:21.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 03-20-2017 , 09:12   Re: Help vip flag
Reply With Quote #5

Use
Code:
else if
, it helps.
__________________
Relaxing is offline
Malatya
New Member
Join Date: Oct 2014
Location: Turkey
Old 03-20-2017 , 16:07   Re: Help vip flag
Reply With Quote #6

PHP Code:
 if (get_user_flagsid ) ) & ADMIN_LEVEL_H ) { 
->

PHP Code:
 if (get_user_flagsid )  & ADMIN_LEVEL_H ) { 
Malatya is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 03-20-2017 , 16:14   Re: Help vip flag
Reply With Quote #7

Change

PHP Code:
new userm3[33
To

PHP Code:
new bool:userm3[33
Set that boolean false at spawn or anywhere you want.

And

PHP Code:
    case 1:
    {
        if( !
is_user_aliveid ) ) 
        {
            
ColorChatidNORMAL,"You can not buy items if you are dead");
            return 
PLUGIN_HANDLED
        }
        else if (
get_user_flagsid ) & ADMIN_LEVEL_H 
        {
            
ColorChatidNORMAL,"You need to be VIP to buy this item");
            return 
PLUGIN_HANDLED
        }
        else if(
userm3[id]) 
        {
            
ColorChatidNORMAL"You have already buy this item before");
            return 
PLUGIN_HANDLED;
        }
        else
        {
            if( 
bm_points[id] >= 30 
            {
                
bm_points[id] -= 30
                
                fm_give_item
id"weapon_m3" )
                
                
cs_set_weapon_ammofind_ent_by_owner( -1"weapon_m3"id ), )
                
cs_set_user_bpammo(idCSW_M30)
                
                
userm3[id] = true
                
                
new szName[32];
                
get_user_name(idszNamecharsmax(szName));
                
ColorChat0NORMAL"%s bought M3"szName )
            } 
            else 
            {
                
ColorChatidNORMAL"You need more points to buy M3")
            }
        }
    } 
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 03-20-2017 at 16:15.
EFFx is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 03-20-2017 , 16:37   Re: Help vip flag
Reply With Quote #8

Else is not needed since hes returning in each if statement
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 03-20-2017 , 16:38   Re: Help vip flag
Reply With Quote #9

I know it, and I didn't noticed it, just organized what he had to organize.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx 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 15:38.


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