Raised This Month: $ Target: $400
 0% 

[REQ] g3sg1 and sg550 only for admins


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
PandaDnB
Senior Member
Join Date: Jan 2012
Old 12-22-2012 , 12:37   [REQ] g3sg1 and sg550 only for admins
Reply With Quote #1

Can you guys make a plugin that allows only admins with flag "p" (ADMIN_LEVEL_D) to buy g3sg1 and sg550? And if you don't have flag "p" when trying to buy g3sg1 or sg550 a message in the chat will appear saying "[Prefix] Only VIP's have access to buy g3sg1/sg550!". Thanks in advance!
PandaDnB is offline
tyin
Member
Join Date: Jun 2011
Location: Macedonia
Old 12-22-2012 , 21:36   Re: [REQ] g3sg1 and sg550 only for admins
Reply With Quote #2

Try this

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fun>

new const g_Prefix[ ] = "[Prefix]";
new 
g_g3sg1_costg_sg550_cost;

public 
plugin_init()
{
    
register_plugin("VIP Weapon""1.0.0""tyiN*");
    
    
g_g3sg1_cost register_cvar("cost_g3sg1""5000")
    
g_sg550_cost register_cvar("cost_sg550""4200")
    
    
register_concmd("g3sg1""weapon_g3sg1");
    
register_concmd("sg550""weapon_sg550");
}

public 
weapon_g3sg1(id)
{
    if (
is_user_connected(id) && is_user_alive(id))
    {
        return;
    }
    if (
get_user_team(id) == && get_user_flags(id) & ADMIN_LEVEL_D )
    {
        
cs_set_user_money(idcs_get_user_money(id) - g_g3sg1_cost)
        
give_itemid"weapon_g3sg1" );
        
emit_soundidCHAN_ITEM"items/gunpickup2.wav"VOL_NORM ATTN_NORM PITCH_NORM );
    }
    else
    {
        
client_print(idprint_chat"%s Only VIP's have access to buy g3sg1!"g_Prefix);
    }
}

public 
weapon_sg550(id)
{
    if (
is_user_connected(id) && is_user_alive(id))
    {
        return;
    }
    if (
get_user_team(id) == && get_user_flags(id) & ADMIN_LEVEL_D )
    {
        
cs_set_user_money(idcs_get_user_money(id) - g_sg550_cost)
        
give_itemid"weapon_sg550" );
        
emit_soundidCHAN_ITEM"items/gunpickup2.wav"VOL_NORM ATTN_NORM PITCH_NORM );
    }
    else
    {
        
client_print(idprint_chat"%s Only VIP's have access to buy sg550!"g_Prefix);
    }


Last edited by tyin; 12-23-2012 at 10:54.
tyin 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 18:24.


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