Raised This Month: $ Target: $400
 0% 

vote menu for min Frags


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sb123
Senior Member
Join Date: Jan 2007
Old 10-18-2010 , 15:01   vote menu for min Frags
Reply With Quote #1

only kill 10 Frags player can open the votemenu

somebody can help me?

PHP Code:
#include <amxmodx>
#include <amxmisc>

#define MENU_SIZE    256
#define MENU_PLAYERS 7

new g_iMenuPosition
new g_iMenuPlayers[32]
new 
g_iMenuOption[32]
new 
g_iMenuSettings[32]


public 
plugin_init()
{
    
register_plugin("Vote Kick/Ban Menu","1.3","WaZZeR")

    
register_menucmd(register_menuid("\rVote Menu:"),1023,"actionVoteMenu")

    
register_clcmd("amx_votemenu","cmdVoteMenu",ADMIN_VOTE,"- displays vote menu")
}


/* Vote Menu */
public cmdVoteMenuidlvlcid )
{
    if( 
cmd_accessidlvlcid) )
    {
        
g_iMenuOption[id] = 0
        g_iMenuSettings
[id] = 0

        showVoteMenu
idg_iMenuPosition )
    }
    return 
PLUGIN_HANDLED
}

public 
showVoteMenuidpos )
{
    if( 
pos ) return

    new 
ij
    
new szMenuBody[MENU_SIZE]
    new 
iCurrKey 0
    
new szUserName[32]
    new 
iStart pos MENU_PLAYERS
    
new iNum

    get_players
g_iMenuPlayersiNum )

    if( 
iStart >= iNum )
        
iStart pos g_iMenuPosition 0

    
new iLen formatszMenuBodyMENU_SIZE-1"\rVote Menu:\R%d/%d^n\w^n"pos+1, (iNum MENU_PLAYERS + ((iNum MENU_PLAYERS) ? )) )
    new 
iEnd iStart MENU_PLAYERS
    
new iKeys = (1<<9|1<<7)

    if( 
iEnd iNum )
        
iEnd iNum

    
for( iStartiEndi++ )
    {
        
g_iMenuPlayers[i]
        
get_user_namejszUserName31 )
        
        
//Check if the player has immunity
        
if( (get_user_flags(j) & ADMIN_IMMUNITY) )
        {
            
iCurrKey++
            
iLen += formatszMenuBody[iLen], (MENU_SIZE-1-iLen), "\d%d. %s^n\w"iCurrKeyszUserName )
        }else
        {
            
iKeys |= (1<<iCurrKey++)
            
iLen += formatszMenuBody[iLen], (MENU_SIZE-1-iLen), "%d. %s^n"iCurrKeyszUserName )
        }
    }
    
//Check if it is kick or ban
    
if ( g_iMenuSettings[id] )
        
iLen += formatszMenuBody[iLen], (MENU_SIZE-1-iLen), "^n8. Vote Ban^n" )
    else
        
iLen += formatszMenuBody[iLen], (MENU_SIZE-1-iLen), "^n8. Vote Kick^n" )

    
//Cheack if there is more players left
    
if( iEnd != iNum )
    {
        
formatszMenuBody[iLen], (MENU_SIZE-1-iLen), "^n9. More...^n0. %s"pos "Back" "Exit" )
        
iKeys |= (1<<8)
    }
    else
        
formatszMenuBody[iLen], (MENU_SIZE-1-iLen), "^n0. %s"pos "Back" "Exit" )

    
show_menuidiKeysszMenuBody, -)

    return
}

public 
actionVoteMenuidkey )
{
    switch( 
key )
    {
        case 
7: {   //The switch key
            
++g_iMenuOption[id]
            
g_iMenuOption[id] %= 2

            
switch(g_iMenuOption[id]){
            case 
0g_iMenuSettings[id] = 0    //kick
            
case 1g_iMenuSettings[id] = 1    //ban
            
}     
            
showVoteMenuidg_iMenuPosition )
        }
        case 
8showVoteMenuid, ++g_iMenuPosition // More Option
        
case 9showVoteMenuid, --g_iMenuPosition // Back Option

        // Chose a Player
        
default:
        {
            new 
player g_iMenuPlayers[g_iMenuPosition MENU_PLAYERS key]

            
//Get user info

            
new authid[32]
            
get_user_authid(player,authid,31)

            new 
userid get_user_userid(player)

            
//Exec the command

            
if (equal("4294967295",authid)) { /* check if it is a lan */
                
new ipa[32]
                
get_user_ip(player,ipa,31,1)
                
server_cmd("addip 0.0 %s;writeip",ipa/* no need to vote on lan, or? */
            
}
            else {
                switch(
g_iMenuSettings[id]){
                    case 
0server_cmd("amx_votekick #%d",userid)
                    case 
1server_cmd("amx_voteban #%d kick;writeid",userid)
                }
            }            
            
server_exec()
        }
    }
    return 
PLUGIN_HANDLED

__________________
sb123 is offline
Send a message via ICQ to sb123 Send a message via MSN to sb123 Send a message via Yahoo to sb123
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 10-18-2010 , 15:26   Re: vote menu for min Frags
Reply With Quote #2

uhm, we are here in scripting help, omg.

get_user_frags()
if()
__________________
Quote:
#define true ((rand() % 2)? true: false) //Happy debugging suckers
mottzi is offline
Send a message via MSN to mottzi
sb123
Senior Member
Join Date: Jan 2007
Old 10-19-2010 , 03:23   Re: vote menu for min Frags
Reply With Quote #3

can u give me full code

i use the plugins on zombie server
__________________
sb123 is offline
Send a message via ICQ to sb123 Send a message via MSN to sb123 Send a message via Yahoo to sb123
Vechta
Veteran Member
Join Date: Jun 2010
Old 10-19-2010 , 04:33   Re: vote menu for min Frags
Reply With Quote #4

Search little bit please and you can make yourself
Vechta is offline
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 10-19-2010 , 10:14   Re: vote menu for min Frags
Reply With Quote #5

Quote:
Originally Posted by sb123 View Post
can u give me full code

i use the plugins on zombie server
NAAAAAAAAA
SCRIPTING HELP; Not I SCRIPT FOU YOU

__________________
Quote:
#define true ((rand() % 2)? true: false) //Happy debugging suckers
mottzi is offline
Send a message via MSN to mottzi
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 10:18.


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