Raised This Month: $12 Target: $400
 3% 

Bool different status on different maps


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Crackhead69
Member
Join Date: Feb 2021
Old 05-05-2021 , 17:54   Bool different status on different maps
Reply With Quote #1

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()


Last edited by Crackhead69; 05-05-2021 at 17:57.
Crackhead69 is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 05-05-2021 , 18:32   Re: Bool different status on different maps
Reply With Quote #2

You can do that with nvault.
https://forums.alliedmods.net/showthread.php?t=91503
__________________








CrazY. is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-05-2021 , 22:06   Re: Bool different status on different maps
Reply With Quote #3

I'd recommend putting load_map_info() in plugin_cfg() instead of client_connect().
__________________
fysiks is offline
Crackhead69
Member
Join Date: Feb 2021
Old 05-06-2021 , 08:51   Re: Bool different status on different maps
Reply With Quote #4

Quote:
Originally Posted by fysiks View Post
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?
Crackhead69 is offline
Old 05-06-2021, 10:12
Black Rose
This message has been deleted by Black Rose. Reason: Terrible solution
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-06-2021 , 17:04   Re: Bool different status on different maps
Reply With Quote #5

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?
__________________
Bugsy is offline
Crackhead69
Member
Join Date: Feb 2021
Old 05-06-2021 , 17:07   Re: Bool different status on different maps
Reply With Quote #6

Just expanding the possibilities.
I will proceed with nvault then.

Thank you all for the answers.
Crackhead69 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 05:37.


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