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

Solved KeyValues Errors


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Anton1823
New Member
Join Date: Sep 2020
Old 09-19-2020 , 05:33   KeyValues Errors
Reply With Quote #1

Hello, I'm trying to make a custom submenu for sm_admin with setting health on players and infinite ammo though only health works
I've also noticed that i got lots of keyvalues errors in the console
Code:
KeyValues Error: RecursiveLoadFromBuffer:  got EOF instead of keyname in file addons/sourcemod/configs/adminmenu_custom.txt
Commands, Custom Commands, Give Health to player..., 2,
KeyValues Error: RecursiveLoadFromBuffer:  got EOF instead of keyname in file addons/sourcemod/configs/adminmenu_custom.txt
Commands, Custom Commands, Give Health to player..., (*2*),
KeyValues Error: RecursiveLoadFromBuffer:  got EOF instead of keyname in file addons/sourcemod/configs/adminmenu_custom.txt
Commands, Custom Commands, (*Give Health to player...*), (*2*),
KeyValues Error: RecursiveLoadFromBuffer:  got EOF instead of keyname in file addons/sourcemod/configs/adminmenu_custom.txt
Commands, (*Custom Commands*), (*Give Health to player...*), (*2*),
Here is the adminmenu_custom.txt file
Code:
"Commands"
{
"Custom Commands"
{
"Give Health to player..."
{
"cmd"            "sm_sethealth #1 @2"
"admin"          "sm_cvar"
"execute"        "player"
"1"
{
"type" 		"groupplayer"
"method"	"name"
"title"		"Player/Team to Edit"
}
"2"
{
"type"       "list"
"title"      "Amount of health"
"1"          "10000"
"1."         "10000"
"2"          "5000"
"2."         "5000"
"3"          "1000"
"3."         "1000"
}
}
"Infinite Ammo for Player"
{
"cmd"            "sm_fia #1 @2"
"admin"          "sm_cvar"
"execute"        "player"
"1"
{
"type" 		"groupplayer"
"method"	"name"
"title"		"Player/Team to Edit"
}
"2"
{
"type"       "list"
"title"      "On or off?"
"1"          "1"
"1."         "On"
"2"          "0"
"2."         "Off"
}
}
}
}
Can someone help?
(I am new to all this sourcemod stuff so i'm sorry if this is a dumb post)

Last edited by Anton1823; 09-19-2020 at 06:36.
Anton1823 is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 09-19-2020 , 05:42   Re: KeyValues Errors
Reply With Quote #2

It works fine. *edit or I have missed something. it worked in game tough.
PHP Code:
// Custom admin menu commands.
// For more information:
//
// http://wiki.alliedmods.net/Custom_Admin_Menu_%28SourceMod%29
//
// Note: This file must be in Valve KeyValues format (no multiline comments)
//

"Commands"
{
    
"Custom Commands"
    
{
        
"Give Health to player..."
        
{
            
"cmd"            "sm_sethealth #1 @2"
            "admin"          "sm_cvar"
            "execute"        "player"
            "1"
            
{
                
"type"         "groupplayer"
                "method"    "name"
                "title"        "Player/Team to Edit"
            
}
            
"2"
            
{
                
"type"       "list"
                "title"      "Amount of health"
                "1"          "10000"
                "1."         "10000"
                "2"          "5000"
                "2."         "5000"
                "3"          "1000"
                "3."         "1000"
            
}
        }
        
"Infinite Ammo for Player"
        
{
            
"cmd"            "sm_fia #1 @2"
            "admin"          "sm_cvar"
            "execute"        "player"
            "1"
            
{
                
"type"         "groupplayer"
                "method"    "name"
                "title"        "Player/Team to Edit"
            
}
            
"2"
            
{
                
"type"       "list"
                "title"      "On or off?"
                "1"          "1"
                "1."         "On"
                "2"          "0"
                "2."         "Off"
            
}
        }
    }

I guess, your txt file is "bad format" when you upload to server (mixing Linux vs Windows format).

You should check FTP program transfer mode, and maybe set it manually to ASCII mode for uploading txt files.

I upload mine, if that help you.
Attached Files
File Type: txt adminmenu_custom.txt (1.1 KB, 121 views)
__________________
Do not Private Message @me

Last edited by Bacardi; 09-19-2020 at 05:43.
Bacardi is offline
Anton1823
New Member
Join Date: Sep 2020
Old 09-19-2020 , 06:16   Re: KeyValues Errors
Reply With Quote #3

Quote:
Originally Posted by Bacardi View Post
It works fine. *edit or I have missed something. it worked in game tough.


I guess, your txt file is "bad format" when you upload to server (mixing Linux vs Windows format).

You should check FTP program transfer mode, and maybe set it manually to ASCII mode for uploading txt files.

I upload mine, if that help you.
There's another problem now, admins don't work
Already tried to take my admins.cfg and admins_simple.ini and save them as ASCII (i think it's ANSI?) but it doesn't work
Anton1823 is offline
Anton1823
New Member
Join Date: Sep 2020
Old 09-19-2020 , 06:33   Re: KeyValues Errors
Reply With Quote #4

Quote:
Originally Posted by Anton1823 View Post
There's another problem now, admins don't work
Already tried to take my admins.cfg and admins_simple.ini and save them as ASCII (i think it's ANSI?) but it doesn't work
Nevermind, the server was somehow running in background so I restarted it. Now it works without any problems. Thank you so much for telling me about this ASCII!

Last edited by Anton1823; 09-19-2020 at 06:35.
Anton1823 is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 09-19-2020 , 09:25   Re: KeyValues Errors
Reply With Quote #5

Good.

Not sure why, I have couple times this issue with Filezilla, when transfer mode is "auto".
Set it to ASCII fixed issue... and just fot txt files, maybe cfg as well
__________________
Do not Private Message @me
Bacardi 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 17:20.


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