Raised This Month: $ Target: $400
 0% 

[SOLVED]to add cvars


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
sabrioz
Senior Member
Join Date: Apr 2009
Old 08-28-2009 , 11:15   [SOLVED]to add cvars
Reply With Quote #1

hello all..
i'm newbie here..

i just want to know how can i add a cvars for this plugin

this is my edited script:

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

const g_GrenadeNum 5;

public 
plugin_init() {
    
register_plugin("HE Only mode""0.1""AlliedModder")
    
register_event("CurWeapon""event_he_off""be""1=0""2=4")
    
register_cvar("amx_he_only""0")
}

public 
event_he_off(id) {
    if (!
get_cvar_num("amx_he_only"))
        return

    
engclient_cmd(id"weapon_hegrenade")
    
client_print(idprint_center"HE only mode is on. You can't swith your weapons!")
}

public 
grenade_throwid greindex wId 
{
    if ( 
wId == CSW_HEGRENADE )
        
cs_set_user_bpammoid CSW_HEGRENADE g_GrenadeNum );

i want to add cvars for enable and disable HE Only Mode..example like this:

say hemod = enable HE Only Mode
say /hemod = enable HE Only Mode

say hemodoff = disable HE Only Mode
say /hemodoff = diasable HE Only Mode

Last edited by sabrioz; 02-12-2010 at 08:17. Reason: Problem Solved
sabrioz is offline
 



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:11.


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