AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Source Servers (SRCDS) (https://forums.alliedmods.net/forumdisplay.php?f=130)
-   -   Solved KeyValues Errors (https://forums.alliedmods.net/showthread.php?t=327446)

Anton1823 09-19-2020 05:33

KeyValues Errors
 
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)

Bacardi 09-19-2020 05:42

Re: KeyValues Errors
 
1 Attachment(s)
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.

Anton1823 09-19-2020 06:16

Re: KeyValues Errors
 
Quote:

Originally Posted by Bacardi (Post 2718172)
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 09-19-2020 06:33

Re: KeyValues Errors
 
Quote:

Originally Posted by Anton1823 (Post 2718174)
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!

Bacardi 09-19-2020 09:25

Re: KeyValues Errors
 
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


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

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