This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

[REQ] VIP Menu - Error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
RiFGanG
Member
Join Date: May 2015
Location: AL-Houceïma, Morroco
Old 07-27-2015 , 09:15   [REQ] VIP Menu - Error
Reply With Quote #1

I Have 5 Error On This Plugin

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <hamsandwich>
#include <cstrike>
#include <fun>
#include <colorchat>
#include <fakemeta>
#pragma tabsize 0

new const szPREFIX[] = "^4[R#G]^1"


new bool:Mic[33]
new 
szInfo1[][] = {
    
"sv_voiceenable",
    
"sv_alltalk"
}
new 
AdminName[33], PlayerName[33]

new 
g_menuPosition[33]
new 
g_menuSelect[33][64]
new 
g_menuUnBanType[33]
new 
g_menuUnBanLine[33][2]
new 
g_menuUnBanText[33][8][32]
new 
g_bannedCfgFile[2][] = {"banned.cfg","listip.cfg"}
new 
g_coloredMenus

#if cellbits == 32
const OFFSET_CLIPAMMO 51
#else
const OFFSET_CLIPAMMO 65
#endif
const OFFSET_LINUX_WEAPONS 4

new const MAXCLIP[] = { -113, -11017, -1303013020253035251220,
            
10301008303020273030, -150 }
new 
g_has_unlimited_clip[33], bool:has_clip[33


public 
plugin_init( )
{
    
register_plugin"\r[R#G] \yVIP Menu""1.0""BooHLaaL" )
    
    
register_clcmd"/vmenu""VIP_Menu"ADMIN_SLAY"\r[R#G] \yVIP Menu")
        
RegisterHam(Ham_Spawn"player""clips_off"1)
    
register_message(get_user_msgid("CurWeapon"), "message_cur_weapon")
        
register_menucmd(register_menuid("UnBan STEAMID Or IP?"),(1<<0|1<<1|1<<9),"actionUnBanMenuType")
    
register_menucmd(register_menuid("UnBan Menu"),1023,"actionUnBanMenu")
    
    
g_coloredMenus colored_menus()
}

public 
VIP_Menuid )
{
    new 
menu menu_create"\r[R#G] \yVIP Menu""Menu_Handler" );
    
    
menu_additemmenu"\yUnBan Menu^n");
    
menu_additemmenu"\wRespawn Player^n");
    
menu_additemmenu"\rGet Unlimited Clip^n");
    
menu_additemmenu"\wMic For All %s^n"Mic[id] ? "\r[ON]":"\d[OFF]");
    
menu_additemmenu"\ySlay Player^n");
    
menu_additemmenu"\wRestart Round^n");
    
    
menu_setpropmenuMPROP_EXITMEXIT_ALL );
    
menu_displayidmenu0);
}
public 
Menu_Handleridmenuitem )
{

        case 
0UnBan(id)
        case 
1ReviveMenu(id)
        case 
2client_cmd(id,"Get_Clip"
        case 
{
    
Mic[id] = !Mic[id];
            
    if(!
Mic[id])
    
Mic_OFF(id)
    else
         
Mic_ON(id)
           }    
        case 
4Slay(id)
        case 
5Rs(id)
    }
    return 
PLUGIN_HANDLED;
}
/*---------------------------------------------| Slay Menu |--------------------------------------*/

public Slay(id)
{
    new 
playermenu menu_create"\r[R#G] \ySlay Menu""PlayerMenu_Handler" );
    
    new 
Players32 ], AdminName32 ], szSteamid35 ]
    new 
Playerpnum;
    
    
get_playersPlayerspnum )
    
    for( new 
0pnumi++ )
    {
        
Player Players]
        
        
get_user_namePlayerAdminNamecharsmaxAdminName ))
        
        
formatexszSteamidcharsmaxszSteamid ), "%d"get_user_useridPlayer ) );
        
        
menu_additemplayermenuAdminNameszSteamid);
    }
    
menu_displayidplayermenu);
}

public 
PlayerMenu_Handleridmenuitem )
{
    }
    new 
szData], AdminName64 ]
    new 
accesscallback;
    
    
menu_item_getinfomenuitemaccessszDatacharsmax(szData), AdminNamecharsmax(AdminName), callback );
    
    new 
Steamid str_to_numszData );
    
    new 
Player find_player"k"Steamid );
    
    if ( 
Player )
    {
        
        
get_user_namePlayerPlayerNamecharsmaxPlayerName ) )
        
get_user_nameidAdminNamecharsmaxAdminName ) )
    
        if( 
Slay == true )
        {
            
ColorChat0GREEN"%s VIP ^4%s ^1Slay Player ^4%s ^1!"szPREFIXAdminNamePlayerName)
            
server_cmd"slay #%d",get_user_name )
        }
    }
    return 
PLUGIN_HANDLED;
}
/*---------------------------------------------| Restart Round |----------------------------------*/

public Rs(id)
{
    static 
AdminName[32];
    
get_user_name(idAdminName 33)
    
server_cmd("sv_restartround 1")
    
ColorChat(id,GREEN,"%s ^1VIP ^4%s ^1Restart The Round ^4!"szPREFIXAdminName)
}
/*---------------------------------------------| Mic [ON] |---------------------------------------*/

public Mic_ON(id)
{
    if (
get_user_flags(id) & ADMIN_KICK )
    {
    
get_user_name(idAdminName32)    
    for ( new 
0sizeof szInfo1 ); i++ )
    
set_cvar_num(szInfo1[i],1)
    
ColorChat(0GREEN"^4[R#G] ^1VIP ^4%s ^1Turned The Mic ^4[ON]^1 For All Players ^4!",AdminName)
    
set_cvar_num("sv_voicequality"5)
    }
    
VIP_Menu(id
}
/*---------------------------------------------| Mic [OFF] |--------------------------------------*/

public Mic_OFF(id)
{
    if (
get_user_flags(id) & ADMIN_KICK )
    {
    
get_user_name(idAdminName32)    
    for ( new 
0sizeof szInfo1 ); i++ )
    
set_cvar_num(szInfo1[i],0)
    
ColorChat(0GREEN"^4[R#G] ^1VIP ^4%s ^1Turned The Mic ^4[OFF]^1 For All Players ^4!",AdminName)
    }
    
VIP_Menu(id)     
}
/*--------------------------------------------| UnBan Menu |--------------------------------------*/

public UnBan(id,key) {
    
    switch(
key) {
    case 
8: {
        
displayUnBanMenu(id, ++g_menuPosition[id])
    }
    case 
9: {
        
g_menuUnBanLine[id][0] = g_menuUnBanLine[id][0] - (g_menuUnBanLine[id][1])
        if(
g_menuUnBanLine[id][0] < 0g_menuUnBanLine[id][0] = 0
        displayUnBanMenu
(id, --g_menuPosition[id])
    }
    default: {
        
        new 
name[32], authid[32], ipaddress[24]
        
get_user_authid(idauthid31)
        
get_user_name(idname31)
        
get_user_ip(idipaddress231)

        
log_amx("UnBan: ^"%s<%d><%s><%s>^" unban ^"%s^""name,get_user_userid(id),authid,ipaddress,g_menuUnBanText[id][key])

        switch (
get_cvar_num("amx_show_activity"))
        {
        
            case 
2ColorChat(0GREEN"%s Admin ^4%s ^1: UnBan ^4%s ^1!"szPREFIXnameg_menuUnBanText[id][key])
            case 
1ColorChat(0GREEN"%s Admin : UnBan ^4%s ^1!"szPREFIXg_menuUnBanText[id][key])
        }

        if(
g_menuUnBanType[id] == 1) {
        
server_cmd("removeip ^"%s^"; writeip"g_menuUnBanText[id][key])
        
server_exec()
        
console_print(id"IP ^"%s^" Removed From Ban List"g_menuUnBanText[id][key])
        }
        
        else {
            
        
server_cmd("removeid %s; writeid",  g_menuUnBanText[id][key])
        
console_print(id"Authid ^"%s^" Removed From Ban List",  g_menuUnBanText[id][key])
        }
    
        
g_menuUnBanLine[id][0] = g_menuUnBanLine[id][1] = 0
        displayUnBanMenu
(idg_menuPosition[id] = 0)
        }
    }
    return 
PLUGIN_HANDLED
}

checkSTEAMID(steamid[]) {
  
    new 
len strlen(steamid)
    if(
len 10 && equali(steamid"STEAM_"6) && steamid[7] == ':' && steamid[9] == ':' && str_to_num(steamid[10])) {
        return 
1
    
}
    return 
0
}

checkIP(ip[]) {
    
    new 
len strlen(ip)
    new 
dots 00
    
while(isdigit(ip[i]) || ip[i]=='.')
        if(
ip[i++] == '.')
            ++
dots
    
if(== len && dots == 3) {
        return 
1
    
}
    return 
0
}

displayUnBanMenu(id,pos) {
    if(
pos 0)
    return

    new 
menuBody[512]
    new 
0

    
new len format(menuBody511g_coloredMenus "\r[R#G] \yUnBan Menu\R%d^n\w^n" "\r[R#G] \yUnBan Menu %d^n^n"pos 1)
    
    new 
keys = (1<<9)
    new 
textlenline
    
new type g_menuUnBanType[id]
    new 
temp[32], banTime[32], disable

    
if(file_exists(g_bannedCfgFile[type])) {
        
line g_menuUnBanLine[id][0]
        while((
line read_file(g_bannedCfgFile[type], lineg_menuSelect[id], 63textlen))) {
            
temp[0] = '^0'
            
banTime[0] = '^0'
            
g_menuUnBanText[id][b][0] = '^0'
            
disable 0
            
if(textlen 9)
                
disable 1
            
else if(parse(g_menuSelect[id], temp31banTime31g_menuUnBanText[id][b], 31) != 3)
                
disable 1
            
else if((type == && !checkIP(g_menuUnBanText[id][b])) || (type == && !checkSTEAMID(g_menuUnBanText[id][b])))
                
disable 1
            
if(disable == 0) {
                
keys |= (1<<b)
                if(
g_coloredMenus)
                
len += format(menuBody[len], 511-len"%d. %s\R\r%s^n\w"bg_menuUnBanText[id][b++], banTime)
                else
                
len += format(menuBody[len], 511-len"%d. %s   ( %s )^n"bg_menuUnBanText[id][b++], banTime)
            }
            else {
                if(
g_coloredMenus)
                    
len += format(menuBody[len], 511-len"\d%d. %s^n\w"bg_menuUnBanText[id][b++])
                else
                    
len += format(menuBody[len], 511-len"#. %s^n"bg_menuUnBanText[id][b++])
            }
            if(
== 8) break
        }

        if(
== && read_file(g_bannedCfgFile[type], lineg_menuSelect[id], 63textlen) > 0) {
        
format(menuBody[len], 511-len"^n9. More...^n0. %s",idpos "Back" "Exit",id)
        
keys |= (1<<8)
        }
        else
        
format(menuBody[len], 511-len"^n0. %s"pos "Back" "Exit",id)

        
g_menuUnBanLine[id][1] = line g_menuUnBanLine[id][0]
        
g_menuUnBanLine[id][0] = line
        show_menu
(idkeysmenuBody, -1"UnBan  Menu")
    }

    return
}

public 
actionUnBanMenuType(id,key) {
    
    switch(
key) {
        case 
9: return PLUGIN_HANDLED
        
default: {
            
g_menuUnBanType[id] = key // 0 = STEAMID, 1 = IP
            
g_menuUnBanLine[id][0] = g_menuUnBanLine[id][1] = 0
            displayUnBanMenu
(idg_menuPosition[id] = 0)
        }
    }
    return 
PLUGIN_HANDLED
}

displayUnBanMenuType(id) {
    
    new 
menuBody[512]
  
    new 
len format(menuBody511g_coloredMenus ?  "\r[R#G] \yUnBan Steam-ID Or IP ?^n\w^n" :"\r[R#G] \yUnBan Steam-ID Or IP ?^n^n",id)

    new 
keys = (1<<0)|(1<<1)|(1<<9)

    
len += format(menuBody[len], 511-len"1. STEAMID^n",id)
    
len += format(menuBody[len], 511-len"2. IP^n",id)
    
format(menuBody[len], 511-len"^n0. Exit",id)

    
show_menu(idkeysmenuBody, -1"UnBan STEAMID Or IP?")
}

public 
UnBan(id,level,cid) {
    
    if(!
cmd_access(id,level,cid,1))
    return 
PLUGIN_HANDLED

    g_menuUnBanType
[id] = -1
    displayUnBanMenuType
(id)
    return 
PLUGIN_HANDLED
}
/*---------------------------------------------| Respawn Menu |-----------------------------------*/

public ReviveMenu(id)
{
    new 
RevivePlayer menu_create ("\r[R#G] \wRespawn Menu""HandleRevive")

    new 
numplayers[32], tempidszTempID [10], tempname [32]
    
get_players (playersnum"cb")

    for (new 
0numi++)
    {
        
tempid players ]

        
get_user_name (tempidtempname31)
        
num_to_str (tempidszTempID9)
        
menu_additem (RevivePlayertempnameszTempID0)
    }

    
menu_display (idRevivePlayer)
    return 
PLUGIN_HANDLED
}

public 
HandleRevive(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu)
        return 
PLUGIN_HANDLED
    
}
    
    new 
data[6], name[64]
    new 
accesscallback
    
    menu_item_getinfo 
(menuitemaccessdata5name63callback)
    new 
tempid str_to_num (data)
    
    
get_user_name(idAdminName32)
    
get_user_name(tempidPlayerName32)
    
    
ExecuteHamB(Ham_CS_RoundRespawntempid)

    
ColorChat(0GREEN"%s Admin ^4%s ^1Respawn Player ^4%s  ^1!",szPREFIXAdminNamePlayerName)    
    
ReviveMenu(id)
    
    return 
PLUGIN_CONTINUE
}
/*---------------------------------------------| Get Unlimited Clip |-----------------------------*/

public client_connect(id
{        
        if(
get_user_flags(id) & ADMIN_KICK || has_clip[id]) 
        {     
    
has_clip[id]=true
        



public 
client_PreThink(id

      if(
get_user_flags(id) & ADMIN_KICK || has_clip[id])  
      { 
       
g_has_unlimited_clip[id] = true
      
}
}
 
public 
clips_off(id)
{
    for (new 
idid <= 32id++) g_has_unlimited_clip[id] = false;
}

// Unlimited clip code
public message_cur_weapon(msg_idmsg_destmsg_entity)
{
    
// Player doesn't have the unlimited clip upgrade
    
if (!g_has_unlimited_clip[msg_entity])
        return;
    
    
// Player not alive or not an active weapon
    
if (!is_user_alive(msg_entity) || get_msg_arg_int(1) != 1)
        return;
    
    static 
weaponclip
    weapon 
get_msg_arg_int(2// get weapon ID
    
clip get_msg_arg_int(3// get weapon clip
    
    // Unlimited Clip Ammo
    
if (MAXCLIP[weapon] > 2// skip grenades
    
{
        
set_msg_arg_int(3get_msg_argtype(3), MAXCLIP[weapon])
        
        if (
clip 2)
        {
            
// Get the weapon entity
            
static wname[32], weapon_ent
            get_weaponname
(weaponwnamesizeof wname 1)
            
weapon_ent fm_find_ent_by_owner(-1wnamemsg_entity)
            
            
// Set max clip on weapon
            
fm_set_weapon_ammo(weapon_entMAXCLIP[weapon])
        }
    }
}

stock fm_find_ent_by_owner(entity, const classname[], owner)
{
    while ((
entity engfunc(EngFunc_FindEntityByStringentity"classname"classname)) && pev(entitypev_owner) != owner) {}
    
    return 
entity;
}

stock fm_set_weapon_ammo(entityamount)
{
    
set_pdata_int(entityOFFSET_CLIPAMMOamountOFFSET_LINUX_WEAPONS);
}



public 
plugin_natives() {
    
register_native("Get_Clip""native_set_user_clip"1);    
}  

public 
native_set_user_clip(idamount)
{
    
g_has_unlimited_clip[id] = amount;
    

Error :

Code:
VIP_Menu.sma(71) : error 014: invalid statement; not in switch
VIP_Menu.sma(71) : warning 215: expression has no effect
VIP_Menu.sma(71) : error 001: expected token: ";", but found ":"
VIP_Menu.sma(71) : error 029: invalid expression, assumed zero
VIP_Menu.sma(71) : fatal error 107: too many error messages on one line
__________________
AL-Houceïma

[RiF#GanG] - [RiF#BoYs] - [Bario#Briro] - [Morroco]
RiFGanG is offline
yash1441
Senior Member
Join Date: Feb 2015
Location: Illuminati HQ
Old 07-27-2015 , 11:21   Re: [REQ] VIP Menu - Error
Reply With Quote #2

You forgot to add switch().

Code:
public Menu_Handler( id, menu, item )
{
PHP Code:
switch(item
{ case 0: UnBan(id) case 1: ReviveMenu(id) case 2: client_cmd(id,"Get_Clip") case 3 { Mic[id] = !Mic[id]; if(!Mic[id]) Mic_OFF(id) else Mic_ON(id) } case 4: Slay(id) case 5: Rs(id) } } return PLUGIN_HANDLED; }

Last edited by yash1441; 07-27-2015 at 11:23. Reason: More elaborated
yash1441 is offline
Send a message via Skype™ to yash1441
indraraj striker
Veteran Member
Join Date: Mar 2014
Location: Under the water
Old 07-28-2015 , 02:09   Re: [REQ] VIP Menu - Error
Reply With Quote #3

@RiFGanG Suggestion
Instead of creating so many menu
simple give access from user.ini no need slay and banmenu
indraraj striker is offline
Reply



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 15:38.


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