Raised This Month: $32 Target: $400
 8% 

Need help with JailBreak


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
joez252
Member
Join Date: Apr 2019
Old 09-30-2019 , 13:36   Need help with JailBreak
Reply With Quote #1


How can i fix that?
I need help with menu.
I need it to be 1,2,3,4,5,6, not to be 3,4,5,1
joez252 is offline
Nexd
BANNED
Join Date: Dec 2013
Location: Hungary
Old 09-30-2019 , 13:45   Re: Need help with JailBreak
Reply With Quote #2

Post your code, otherwise we can't help you
Nexd is offline
joez252
Member
Join Date: Apr 2019
Old 09-30-2019 , 14:22   Re: Need help with JailBreak
Reply With Quote #3

Quote:
Originally Posted by Nexd View Post
Post your code, otherwise we can't help you
I use this plugin (s): https://forums.alliedmods.net/showthread.php?t=283212
I have this problem with everyone menus here.
I am currently using a custom menu:
PHP Code:
/*
 * MyJailbreak - Custom Menu Items Plugin.
 * by: shanapu
 * https://github.com/shanapu/MyJailbreak/
 * 
 * Copyright (C) 2016-2017 Thomas Schmidt (shanapu)
 *
 * This file is part of the MyJailbreak SourceMod Plugin.
 *
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU General Public License, version 3.0, as published by the
 * Free Software Foundation.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <http://www.gnu.org/licenses/>.
 */


// Includes
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <cstrike>
#include <myjailbreak>
#include <mystocks>
#include <warden>
#include <myjbwarden>


// Compiler Options
#pragma semicolon 1
#pragma newdecls required

// Handles
Handle g_hCommandTrie;

// Strings
char g_sMenuFile[64];

// Start
public Plugin myinfo =
{
    
name "MyJailbreak - Custom Menu items",
    
author "shanapu",
    
description "Additional menu item per cfg",
    
version MYJB_VERSION,
    
url MYJB_URL_LINK
};

// Info
public void OnPluginStart()
{
    
//Configs Path
    
BuildPath(Path_SMg_sMenuFilesizeof(g_sMenuFile), "configs/MyJailbreak/menu_custom.cfg");
    
g_hCommandTrie CreateTrie();
}


// Here we add an new item to the beginn of the menu
public void MyJailbreak_MenuStart(int clientMenu menu)
{
    
File hFile OpenFile(g_sMenuFile"rt");

    if (
hFile == null)
    {
        
delete hFile;
        
SetFailState("MyJailbreak Menu - Can't open File: %s"g_sMenuFile);
    }
    
delete hFile;

    
KeyValues kvMenu = new KeyValues("CustomMenuItems");

    if (!
kvMenu.ImportFromFile(g_sMenuFile))
    {
        
delete kvMenu;
        
SetFailState("MyJailbreak Menu - Can't read %s correctly! (ImportFromFile)"g_sMenuFile);
    }

    if (!
kvMenu.GotoFirstSubKey())
    {
        
delete kvMenu;
        
SetFailState("MyJailbreak Menu - Can't read %s correctly! (GotoFirstSubKey)"g_sMenuFile);
    }
    do
    {
        
char sID[32];

        
kvMenu.GetString("postion"sIDsizeof(sID));
        if (!
StrEqual(sID"top"false))
        {
            continue;
        }

        
char sTitle[64];
        
char sRole[32];
        
char sFlags[64];
        
char sCommand[64];

        
kvMenu.GetSectionName(sIDsizeof(sID));
        
kvMenu.GetString("title"sTitlesizeof(sTitle));
        
kvMenu.GetString("role"sRolesizeof(sRole));
        
kvMenu.GetString("flags"sFlagssizeof(sFlags));
        
kvMenu.GetString("command"sCommandsizeof(sCommand));

        if (!
CheckVipFlag(clientsFlags))
            continue;

        if (
warden_iswarden(client))
        {
            if (
StrContains(sRole"1") != -1)
            {
                
menu.AddItem(sIDsTitle);
            }
        }
        else if (
warden_deputy_isdeputy(client))
        {
            if (
StrContains(sRole"2") != -1)
            {
                
menu.AddItem(sIDsTitle);
            }
        }
        else if (
GetClientTeam(client) == CS_TEAM_CT)
        {
            if (
StrContains(sRole"3") != -1)
            {
                
menu.AddItem(sIDsTitle);
            }
        }
        else if (
GetClientTeam(client) == CS_TEAM_T)
        {
            if (
StrContains(sRole"4") != -1)
            {
                
menu.AddItem(sIDsTitle);
            }
        }
        else if (
GetClientTeam(client) == CS_TEAM_SPECTATOR)
        {
            if (
StrContains(sRole"5") != -1)
            {
                
menu.AddItem(sIDsTitle);
            }
        }

        
SetTrieString(g_hCommandTriesIDsCommand);

    }
    while (
kvMenu.GotoNextKey());

    
delete kvMenu;

}


// Here we add an new item to the end of the menu
public void MyJailbreak_MenuEnd(int clientMenu menu)
{
    
File hFile OpenFile(g_sMenuFile"rt");

    if (
hFile == null)
    {
        
delete hFile;
        
SetFailState("MyJailbreak Menu - Can't open File: %s"g_sMenuFile);
    }

    
KeyValues kvMenu = new KeyValues("CustomMenuItems");

    if (!
kvMenu.ImportFromFile(g_sMenuFile))
    {
        
delete kvMenu;
        
SetFailState("MyJailbreak Menu - Can't read %s correctly! (ImportFromFile)"g_sMenuFile);
    }

    if (!
kvMenu.GotoFirstSubKey())
    {
        
delete kvMenu;

        
SetFailState("MyJailbreak Menu - Can't read %s correctly! (GotoFirstSubKey)"g_sMenuFile);
    }
    do
    {
        
char sID[32];

        
kvMenu.GetString("postion"sIDsizeof(sID));
        if (!
StrEqual(sID"bottom"false))
        {
            continue;
        }

        
char sTitle[64];
        
char sRole[32];
        
char sFlags[64];
        
char sCommand[64];

        
kvMenu.GetSectionName(sIDsizeof(sID));
        
kvMenu.GetString("title"sTitlesizeof(sTitle));
        
kvMenu.GetString("role"sRolesizeof(sRole));
        
kvMenu.GetString("flags"sFlagssizeof(sFlags));
        
kvMenu.GetString("command"sCommandsizeof(sCommand));

        if (!
CheckVipFlag(clientsFlags))
            continue;

        if (
warden_iswarden(client))
        {
            if (
StrContains(sRole"1") != -1)
            {
                
menu.AddItem(sIDsTitle);
            }
        }
        else if (
warden_deputy_isdeputy(client))
        {
            if (
StrContains(sRole"2") != -1)
            {
                
menu.AddItem(sIDsTitle);
            }
        }
        else if (
GetClientTeam(client) == CS_TEAM_CT)
        {
            if (
StrContains(sRole"3") != -1)
            {
                
menu.AddItem(sIDsTitle);
            }
        }
        else if (
GetClientTeam(client) == CS_TEAM_T)
        {
            if (
StrContains(sRole"4") != -1)
            {
                
menu.AddItem(sIDsTitle);
            }
        }
        else if (
GetClientTeam(client) == CS_TEAM_SPECTATOR)
        {
            if (
StrContains(sRole"5") != -1)
            {
                
menu.AddItem(sIDsTitle);
            }
        }
        
SetTrieString(g_hCommandTriesIDsCommand);

    }
    while (
kvMenu.GotoNextKey());

    
delete hFile;
    
delete kvMenu;
}


// What should we do when new item was picked?
public void MyJailbreak_MenuHandler(Menu menuMenuAction actionint clientint itemNum)
{
    
char command[24];

    if (
action == MenuAction_Select)
    {
        if (
IsValidClient(clientfalsetrue))
        {
            
char info[64];
            
menu.GetItem(itemNuminfosizeof(info));

            if (
GetTrieString(g_hCommandTrieinfocommandsizeof(command)))
            {
                
FakeClientCommand(clientcommand);
            }
        }
    }
    else if (
action == MenuAction_End)
    {
        
delete menu;
    }

joez252 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 20:38.


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