Raised This Month: $ Target: $400
 0% 

CVAR Problem


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 04-17-2011 , 22:47   Re: CVAR Problem
Reply With Quote #5

I think initializations and init should be suffice.

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <nvault>
#include <hamsandwich>
#include <cstrike>
#include <fun>
#include <fakemeta>
#include <colorchat>

const gItemAmount 11;

new 
gMoneyVault;
new 
gJBPoints[33];

new 
bool:gHasKatana[33];
new 
bool:gHasKnife[33];

new 
bool:gBoughtMac10[33];
new 
bool:gBoughtTMP[33];
new 
bool:gBoughtDeagle[33];
new 
bool:gBoughtFrag[33];
new 
bool:gBoughtFlash[33];
new 
bool:gBoughtSmoke[33];
new 
bool:gBoughtRambo[33];

new 
gKnifeType[33];

new 
gChosenPlayer[33];

new const 
gItemNames[gItemAmount][] = 
{
    
"Katana Knife",
    
"Professional Knife",
    
"Mac-10",
    
"TMP",
    
"Deagle",
    
"+100 HP",
    
"+100 AP",
    
"HE Grenade",
    
"Flashbang",
    
"Smoke Grenade",
    
"Flying Rambo"
};

new const 
gPlayerModels[2][] = 
{
    
"models/knife/p_katana.mdl",
    
"models/knife/p_proff.mdl"
};

new const 
gViewModels[2][] = 
{
    
"models/knife/v_katana.mdl",
    
"models/knife/v_proff.mdl"
};

enum
{
    
KATANA,
    
KNIFE,
    
MAC,
    
TMP,
    
DEAGLE,
    
HP,
    
AP,
    
HE,
    
FLASH,
    
SMOKE,
    
RAMBO
};

new 
gpKatanaCost;
new 
gpProKnifeCost;
new 
gpMac10Cost;
new 
gpTMPCost;
new 
gpDeagleCost;
new 
gpHealthCost;
new 
gpArmorCost;
new 
gpFragCost;
new 
gpFlashCost;
new 
gpSmokeCost;
new 
gpRamboCost;

new 
gpHeadshotReward;
new 
gpKillReward;
new 
gpKatanaReward;

new 
gpRamboHealth;

public 
plugin_init()
{
    
register_plugin"Jailbreak Shop""1.0""H3avY Ra1n" );
    
    
gpKatanaCost         =         register_cvar(         "jb_katana_cost",         "45000"     );
    
gpProKnifeCost         =         register_cvar(         "jb_proknife_cost",     "25000"     );
    
gpMac10Cost         =         register_cvar(         "jb_mac10_cost",         "3200"         );
    
gpTMPCost             =         register_cvar(         "jb_tmp_cost",             "3200"         );
    
gpDeagleCost         =         register_cvar(         "jb_deagle_cost",         "4000"         );
    
gpHealthCost         =         register_cvar(         "jb_health_cost",         "1000"         );
    
gpArmorCost         =         register_cvar(         "jb_armor_cost",         "800"         );
    
gpFragCost             =         register_cvar(         "jb_hegrenade_cost",     "1000"         );
    
gpFlashCost         =         register_cvar(         "jb_flashbang_cost",     "500"         );
    
gpSmokeCost         =         register_cvar(         "jb_smokegrenade_cost""500"         );
    
gpRamboCost         =         register_cvar(         "jb_rambo_cost",         "10000"     );
    
    
gpHeadshotReward register_cvar"jb_headshot_reward""100" );
    
gpKillReward register_cvar"jb_kill_reward""200" );
    
gpRamboHealth register_cvar"jb_rambo_health""150" );
    
gpKatanaReward register_cvar"jb_katana_reward""400" );
    
    
gMoneyVault nvault_open"jb_shop" );
    
    new 
cvar register_cvar"test_cvar""10" );
    
    
server_print"%i"get_pcvar_numcvar ) );
    
register_event"DeathMsg""Event_DeathMsg""a" );
    
register_event"CurWeapon""Event_CurWeapon""be""1=1" );

    
register_concmd"amx_jbshop""CmdAdminControl"ADMIN_ADMIN );
    
    
register_clcmd"say""CmdSay" );
    
register_clcmd"say_team""CmdSay" );
    
    
register_clcmd"_amount_take""CmdTake"ADMIN_ADMIN );
    
register_clcmd"_amount_give""CmdGive"ADMIN_ADMIN );
    
    
register_logevent"Event_RoundEvent"3"1=Round_Start""2=Round_End" );
    
    
RegisterHamHam_Spawn"player""Event_PlayerSpawn");
}

public 
plugin_end()
{
    
nvault_closegMoneyVault );
}

public 
plugin_cfg()
{
    
server_print"The katana cost is %i"get_pcvar_numgpKatanaCost ) );

__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
 



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 19:59.


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