Raised This Month: $18 Target: $400
 4% 

Solved ZombieBasebuilder.ini


Post New Thread Reply   
 
Thread Tools Display Modes
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 07-12-2020 , 17:38   Re: ZombieBasebuilder.ini
Reply With Quote #11

Just look at any plugin that has an .ini file and try to understand the code. There's one in my signature.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Supremache
Senior Member
Join Date: Sep 2019
Old 07-12-2020 , 19:01   Re: ZombieBasebuilder.ini
Reply With Quote #12

Quote:
Originally Posted by OciXCrom View Post
Just look at any plugin that has an .ini file and try to understand the code. There's one in my signature.
I Doing this, is that correct ?
PHP Code:
new g_eSettings[Settings]
enum _:Settings //Cvars
{
    
CVAR_BUILDTIME,
    
CVAR_PREPTIME,
    
CVAR_ZOMBIE_RESPAWN_DELAY,
    
CVAR_INFECTION_RESPAWN,
    
CVAR_SHOWMOVERS,
    
CVAR_LOCKBLOCKS,
    
CVAR_LOCKMAX,
    
CVAR_COLORMOD,
    
CVAR_MAX_MOVE_DIST,
    
CVAR_MIN_MOVE_DIST,
    
CVAR_MIN_DIST_SET,
    
CVAR_RESET_BLOCKS,
    
CVAR_ZOMBIE_SUPERCUT,
    
CVAR_GUNS_MENU,
    
CVAR_ROUND_NADES,
    
CVAR_WEAPONS

Change cvars from g_iPrepTime to g_eSettings[CVAR_PREPTIME] right?

PHP Code:
if (((/*g_boolPrepTime && */g_iPrepTime && !g_boolCanBuild) || (g_boolCanBuild && !g_iPrepTime)) && g_iGunsMenu)
            {
                
print_color(id"%s Press^x04 E ^x01to move an opjects"MODNAME);
                
//if (is_credits_active())
                #if defined BB_CREDITS
                    
credits_show_gunsmenu(id)
                
#else
                    
show_method_menu(id)
                
#endif
            

PHP Code:
if (((/*g_boolPrepTime && */g_eSettings[CVAR_PREPTIME] && !g_boolCanBuild) || (g_boolCanBuild && !g_eSettings[CVAR_PREPTIME])) && g_iGunsMenu)
            {
                
print_color(id"%s Press^x04 E ^x01to move an opjects"MODNAME);
                
//if (is_credits_active())
                #if defined BB_CREDITS
                    
credits_show_gunsmenu(id)
                
#else
                    
show_method_menu(id)
                
#endif
            

In file section is that correct ?
PHP Code:
if (equal(key"PREPTIME"))
                    
g_eSettings[CVAR_PREPTIME] = _:clamp(str_to_num(szValue)) 
Supremache is offline
Supremache
Senior Member
Join Date: Sep 2019
Old 07-13-2020 , 07:45   Re: ZombieBasebuilder.ini
Reply With Quote #13

Quote:
Originally Posted by Supremache View Post
I Doing this, is that correct ?
PHP Code:
new g_eSettings[Settings]
enum _:Settings //Cvars
{
    
CVAR_BUILDTIME,
    
CVAR_PREPTIME,
    
CVAR_ZOMBIE_RESPAWN_DELAY,
    
CVAR_INFECTION_RESPAWN,
    
CVAR_SHOWMOVERS,
    
CVAR_LOCKBLOCKS,
    
CVAR_LOCKMAX,
    
CVAR_COLORMOD,
    
CVAR_MAX_MOVE_DIST,
    
CVAR_MIN_MOVE_DIST,
    
CVAR_MIN_DIST_SET,
    
CVAR_RESET_BLOCKS,
    
CVAR_ZOMBIE_SUPERCUT,
    
CVAR_GUNS_MENU,
    
CVAR_ROUND_NADES,
    
CVAR_WEAPONS

Change cvars from g_iPrepTime to g_eSettings[CVAR_PREPTIME] right?

PHP Code:
if (((/*g_boolPrepTime && */g_iPrepTime && !g_boolCanBuild) || (g_boolCanBuild && !g_iPrepTime)) && g_iGunsMenu)
            {
                
print_color(id"%s Press^x04 E ^x01to move an opjects"MODNAME);
                
//if (is_credits_active())
                #if defined BB_CREDITS
                    
credits_show_gunsmenu(id)
                
#else
                    
show_method_menu(id)
                
#endif
            

PHP Code:
if (((/*g_boolPrepTime && */g_eSettings[CVAR_PREPTIME] && !g_boolCanBuild) || (g_boolCanBuild && !g_eSettings[CVAR_PREPTIME])) && g_iGunsMenu)
            {
                
print_color(id"%s Press^x04 E ^x01to move an opjects"MODNAME);
                
//if (is_credits_active())
                #if defined BB_CREDITS
                    
credits_show_gunsmenu(id)
                
#else
                    
show_method_menu(id)
                
#endif
            

In file section is that correct ?
PHP Code:
if (equal(key"PREPTIME"))
                    
g_eSettings[CVAR_PREPTIME] = _:clamp(str_to_num(szValue)) 
This is what i have to do ? or all that are not correct
Supremache is offline
ZaX
Senior Member
Join Date: Jan 2015
Old 07-13-2020 , 09:21   Re: ZombieBasebuilder.ini
Reply With Quote #14

If youre storing CVars in .ini then whats the point? Why dont you just store them in a cfg file and execute them ?
If you want to use ini file use it for keys and values, and remove all the CVars
For instance - section can be
Code:
[BaseBuilder]
Key = PREPARE TIME
value = 20
Correct me if im mistaken, but i see no point of saving the CVars in the INI file as it will not change the cvars value, will it?
ZaX is offline
Supremache
Senior Member
Join Date: Sep 2019
Old 07-13-2020 , 09:27   Re: ZombieBasebuilder.ini
Reply With Quote #15

Quote:
Originally Posted by ZaX View Post
If youre storing CVars in .ini then whats the point? Why dont you just store them in a cfg file and execute them ?
Code:
[BaseBuilder]
Key = PREPARE TIME
value = 20
Correct me if im mistaken, but i see no point of saving the CVars in the INI file as it will not change the cvars value, will it?
I was want to do this but this mod have cvar in "public plugin_precache"and i cant edit them from cfg file and if i move them to "public plugin_init" the mod will not be working

Quote:
If you want to use ini file use it for keys and values, and remove all the CVars
For instance - section can be
What do you mean, i dont understand!!!

Last edited by Supremache; 07-13-2020 at 09:45.
Supremache is offline
Supremache
Senior Member
Join Date: Sep 2019
Old 07-14-2020 , 20:02   Re: ZombieBasebuilder.ini
Reply With Quote #16

UP UP UP !!!..
Supremache is offline
Foxa
Member
Join Date: Nov 2018
Location: Croatia
Old 07-15-2020 , 05:47   Re: ZombieBasebuilder.ini
Reply With Quote #17

Shouldn't this:
PHP Code:
if (equal(key"MOD ENABLE/DISABLE"))
                  
g_pcvar_enabled str_to_num(value
be this: - do that for all values in the switch() statement
PHP Code:
if (equal(key"MOD ENABLE/DISABLE"))
                 
set_pcvar_num(g_pcvar_enabledstr_to_num(value)) 
or am I missing something?

Last edited by Foxa; 07-15-2020 at 05:47.
Foxa is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 07-15-2020 , 09:27   Re: ZombieBasebuilder.ini
Reply With Quote #18

i already told you the answer stop bumping your thread thousand times.
__________________
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Supremache
Senior Member
Join Date: Sep 2019
Old 07-15-2020 , 13:10   Re: ZombieBasebuilder.ini
Reply With Quote #19

@ Foxa - How that can be work ??? !!!
@Natsheh - Bro I said i dont understand what do you mean, i want example plz
Supremache is offline
Foxa
Member
Join Date: Nov 2018
Location: Croatia
Old 07-15-2020 , 20:31   Re: ZombieBasebuilder.ini
Reply With Quote #20

Yes, that should work, since thats how you change a cvar value with a pointer cvar, what you did the code that you posted does NOTHING.
Foxa is offline
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 14:13.


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