AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Bool different status on different maps (https://forums.alliedmods.net/showthread.php?t=332322)

Crackhead69 05-05-2021 17:54

Bool different status on different maps
 
Hello!
Can somebody help me out on how i can save bool's status on the map i am currently in.

I want to be able to change the bool status while in game, and when i rejoin that map that bool to be the value i left it on
PHP Code:

new bool:TestStatus

public plugin_init()
    
register_clcmd("say /changebool","BoolAlter")
    
public 
BoolAlter()
{
    if(
TestStatus == true){
        
TestStatus false
    
}else{
        
TestStatus true
    
}
    
    
save_map_info()
}

public 
client_connect(id)
{
    
load_map_info()



CrazY. 05-05-2021 18:32

Re: Bool different status on different maps
 
You can do that with nvault.
https://forums.alliedmods.net/showthread.php?t=91503

fysiks 05-05-2021 22:06

Re: Bool different status on different maps
 
I'd recommend putting load_map_info() in plugin_cfg() instead of client_connect().

Crackhead69 05-06-2021 08:51

Re: Bool different status on different maps
 
Quote:

Originally Posted by fysiks (Post 2746072)
I'd recommend putting load_map_info() in plugin_cfg() instead of client_connect().

Indeed i should, thanks.
Is there tho an alternative?
Can i work it out without nvault?

Bugsy 05-06-2021 17:04

Re: Bool different status on different maps
 
SQL or creating your own external file. Though, nVault is the easiest and requires hardly any coding experience. Why are you trying to avoid it?

Crackhead69 05-06-2021 17:07

Re: Bool different status on different maps
 
Just expanding the possibilities.
I will proceed with nvault then.

Thank you all for the answers.


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

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