AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   REQUEST: Dual Elites for CT. (https://forums.alliedmods.net/showthread.php?t=165643)

Preyas3 08-25-2011 03:02

REQUEST: Dual Elites for CT.
 
Title says all.

Stressful 08-25-2011 03:52

Re: REQUEST: Dual Elites for CT.
 
You need more description . During round start , CT get it or ?

Preyas3 08-25-2011 08:11

Re: REQUEST: Dual Elites for CT.
 
CT can buy it.

bibu 08-25-2011 08:28

Re: REQUEST: Dual Elites for CT.
 
Gonna do that, give me some time.

Here you go:

PHP Code:

#include <amxmodx>
#include <fun>
#include <cstrike>

#define PLUGIN "Buy Elite for CT's"
#define VERSION "1.0"
#define AUTHOR "AMXX Community"

new cvar_costcvar_ammo

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /elite""buy_elite")
    
    
cvar_cost register_cvar("amx_elite_cost""1000")
    
cvar_ammo register_cvar("amx_elite_ammo""120")
}

public 
buy_elite(id)
{
    if(!
is_user_alive(id) || cs_get_user_team(id) != CS_TEAM_CT || user_has_weapon(idCSW_ELITE))
    {
        
client_print(idprint_center"#Cstrike_TitlesTXT_Cannot_Buy_This")
        return 
PLUGIN_HANDLED
    
}
    
    new 
money cs_get_user_money(id)
    new 
cost get_pcvar_num(cvar_cost)
    
    if(
money >= cost)
    {
        
cs_set_user_money(idmoney cost)
        
        
give_item(id"weapon_elite")
        
cs_set_user_bpammo(idCSW_ELITEget_pcvar_num(cvar_ammo))
    }
    else
    {
        
client_print(idprint_center"#Cstrike_TitlesTXT_Not_Enough_Money")
        return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_HANDLED



Preyas3 08-26-2011 01:41

Re: REQUEST: Dual Elites for CT.
 
Thanks! :D

ConnorMcLeod 08-26-2011 02:20

Re: REQUEST: Dual Elites for CT.
 
cs_set_user_bpammo(id, CSW_ELITE, get_pcvar_num(cvar_ammo))

You shouldn't add it like this, you should first retrieve the amount of bpammo the player have to make sure you don't lowering that ammo, may be add ammo and set a max limit (Ham_AddAmmo).

dimaspaf14 10-12-2020 08:04

Re: REQUEST: Dual Elites for CT.
 
When i play the game with this plugins there a bug that i find on this plugins.
the bug is when i have a secondary weapon, then i buy elites, i have 2 pistols.
when i dropped one of them, the player is'nt pickup 2 pistol anymore...


All times are GMT -4. The time now is 14:27.

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