AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   put on cfg (https://forums.alliedmods.net/showthread.php?t=106296)

DoviuX 10-13-2009 14:07

put on cfg
 
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"); 


Exolent[jNr] 10-13-2009 14:08

Re: put on cfg
 
What do you mean by put them?
Do you want the plugin to read/write to a .cfg file?

DoviuX 10-13-2009 14:15

Re: put on cfg
 
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

Exolent[jNr] 10-13-2009 14:16

Re: put on cfg
 
What?

DoviuX 10-14-2009 12:03

Re: put on cfg
 
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

Exolent[jNr] 10-14-2009 12:07

Re: put on cfg
 
healthpotion -> amx_potion_health

One 10-14-2009 12:07

Re: put on cfg
 
Quote:

Originally Posted by DoviuX (Post 961653)
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] (Post 961655)
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"

Exolent[jNr] 10-14-2009 12:11

Re: put on cfg
 
@One
Did you even look at the cvar value in the config?
That is why I chose amx_potion_health.

One 10-14-2009 12:15

Re: put on cfg
 
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" :P


All times are GMT -4. The time now is 22:35.

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