Raised This Month: $ Target: $400
 0% 

put on cfg


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DoviuX
Senior Member
Join Date: Jun 2009
Location: Lithuania
Old 10-13-2009 , 14:07   put on cfg
Reply With Quote #1

how can i put these cvars on cfg file ?

PHP Code:
    hp register_cvar("amx_potion_health""100");
    
sp register_cvar("amx_potion_speed""100"); 
DoviuX is offline
Send a message via Skype™ to DoviuX
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-13-2009 , 14:08   Re: put on cfg
Reply With Quote #2

What do you mean by put them?
Do you want the plugin to read/write to a .cfg file?
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
DoviuX
Senior Member
Join Date: Jun 2009
Location: Lithuania
Old 10-13-2009 , 14:15   Re: put on cfg
Reply With Quote #3

It's like on .cfg file amx_potion_health", "100" this but it writes in cfg HP_POTION GIVES = "Number how much hp gives" and it sets to server
DoviuX is offline
Send a message via Skype™ to DoviuX
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-13-2009 , 14:16   Re: put on cfg
Reply With Quote #4

What?
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
DoviuX
Senior Member
Join Date: Jun 2009
Location: Lithuania
Old 10-14-2009 , 12:03   Re: put on cfg
Reply With Quote #5

In Plugin

PHP Code:
{
    
//Other stuff
    
hp register_cvar("amx_potion_health""100");
    
sp register_cvar("amx_potion_speed""100");
    
gp register_cvar("amx_potion_gravity""0.6");
    
    
//Potion Cost
      
healthpotion register_cvar("price_hp""4000")
      
speedpotion register_cvar("price_sp""4000")
      
gravitypotion register_cvar("price_gp""4000")
    
imortalitypotion register_cvar("price_ip""16000")

    
//Special Shop Cost
    
randomgun register_cvar("price_gun""16000")
    
armor register_cvar("price_armor""4000")
    
randomgrenade register_cvar("price_grenade""5000")
}
public 
plugin_cfg()
{
    
// Get configs dir
    
new cfgdir[32]
    
get_configsdir(cfgdircharsmax(cfgdir))

    
// Execute config file (shop.cfg)
    
server_cmd("exec %s/shop.cfg"cfgdir)

in Cfg:

Code:
// General
// -------
healthpotion "100" // How much hp restores health potion
and etc
DoviuX is offline
Send a message via Skype™ to DoviuX
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-14-2009 , 12:07   Re: put on cfg
Reply With Quote #6

healthpotion -> amx_potion_health
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 10-14-2009 , 12:07   Re: put on cfg
Reply With Quote #7

Quote:
Originally Posted by DoviuX View Post
In Plugin

PHP Code:
{
    
//Other stuff
    
hp register_cvar("amx_potion_health""100");
    
sp register_cvar("amx_potion_speed""100");
    
gp register_cvar("amx_potion_gravity""0.6");
    
    
//Potion Cost
      
healthpotion register_cvar("price_hp""4000")
      
speedpotion register_cvar("price_sp""4000")
      
gravitypotion register_cvar("price_gp""4000")
    
imortalitypotion register_cvar("price_ip""16000")

    
//Special Shop Cost
    
randomgun register_cvar("price_gun""16000")
    
armor register_cvar("price_armor""4000")
    
randomgrenade register_cvar("price_grenade""5000")
}
public 
plugin_cfg()
{
    
// Get configs dir
    
new cfgdir[32]
    
get_configsdir(cfgdircharsmax(cfgdir))

    
// Execute config file (shop.cfg)
    
server_cmd("exec %s/shop.cfg"cfgdir)

in Cfg:

Code:
// General
// -------
price_hp "100" // How much hp restores health potion
and etc
Quote:
Originally Posted by Exolent[jNr] View Post
healthpotion -> amx_potion_health

huh? see here :

healthpotion = register_cvar("price_hp", "4000")


// You'r Cvars are the red cvars :

hp = register_cvar("amx_potion_health", "100");
sp = register_cvar("amx_potion_speed", "100");
gp = register_cvar("amx_potion_gravity", "0.6");


// this in config.
amx_potion_health "100"
amx_potion_speed "100"
amx_potion_gravity "0.6"
__________________

Last edited by One; 10-14-2009 at 12:10.
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-14-2009 , 12:11   Re: put on cfg
Reply With Quote #8

@One
Did you even look at the cvar value in the config?
That is why I chose amx_potion_health.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 10-14-2009 , 12:15   Re: put on cfg
Reply With Quote #9

ok he was wrong. because i just read :

healthpotion "100" // How much hp restores health potion

& for me looks healthpotion so :

healthpotion = register_cvar("price_hp", "4000")

that's why i writed price_hp "xxx"
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
Reply


Thread Tools
Display Modes

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 22:35.


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