AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   help lastmenu (https://forums.alliedmods.net/showthread.php?t=107013)

spirit 10-21-2009 13:52

help lastmenu
 
Hi all can you help me for this code. I need create a menu for the last CT and T who the lastman say /last a menu's open and 2 choice possible (shoot for shoot and knife duel). When I choose the knife duel or shoot for shoot my enemy have 15 second for acept or decline. (disarm 2 player and give just knife for knife duel and deagle for shoot for shoot).
But i'm noob for make this menu.
Can you help me please


PHP Code:

#include <amxmodx>
#include <cstrike>
#include <fun>

#define PLUGIN    "last_menu"
#define AUTHOR    "spirit"
#define VERSION    "1.0"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_event"DeathMsg""Event_DeathMsg""a" );
    
register_clcmd"say /last","lastman");
    
register_clcmd"say_team /last","lastman");
    
register_clcmd"say_team /last","lastman");
}

public 
Event_DeathMsg() 
{
    new 
Players32 ];
    new 
Num;
    new 
Count;
    
get_playersPlayersNum"a" );
    
    for ( new 
0Numi++ )  
    {
        switch( 
cs_get_user_teamPlayers ) )
        {
            case 
CS_TEAM_T:
            {
                
Count++
            }
            case 
CS_TEAM_CT:
            {
                
Count++
            }
        }
    }
}

public 
lastman(id)
{
    new 
menu menu_create("\lastman:""last_menu"//menu 
    
menu_additem(menu"\wknife duel""1"0);
    
menu_additem(menu"\wshoot for shoot""2"0);
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
menu_display(idmenu0);
}

public 
last_menu (id
    
//help code

 
switch(key)
{
    case 
1:
    {
        if( 
is_user_alive(id) )
        
give_item(id"weapon_knife");
        
set_user_health(id100);
        
set_hudmessage(50255)
        
//disarm all
        
strip_user_weapons      
        show_hudmessage
(0,"You have choose knife duel.")  
    }
    case 
2:
    {
        if( 
is_user_alive(id) )
            
//disarm team 
        
strip_user_weapons    
        
// they delay them has 100hp as well as a deagle 
        
set_user_health(id100);
        
give_item(id,"weapon_deagle")
        
cs_set_user_bpammo(id,CSW_DEAGLE,200)
        
set_hudmessage(50255)
        
show_hudmessage(0,"You have choose shoot for shoot.")  
    }

// addition of the time of answer with 2 choices possible 

Can you help me is different of last request because it's for last CT and T and it have a time of answer.

OneMoreLevel 10-21-2009 13:55

Re: help lastmenu
 
Use strip_user_weapons instead of all those client_cmds . That is one problem.

spirit 10-21-2009 14:03

Re: help lastmenu
 
PHP Code:

 switch(key)
{
    case 
1:
    {
        if( 
is_user_alive(id) )
            
give_item(id"weapon_knife");
        
set_user_health(id100);
        
set_hudmessage(50255)
        
//disarm all
        
strip_user_weapons      
        show_hudmessage
(0,"You have choose knife duel.")  
    }
    case 
2:
    {
        if( 
is_user_alive(id) )
            
//disarm team 
        
strip_user_weapons    
        
// they delay them has 100hp as well as a deagle 
        
set_user_health(id100);
        
give_item(id,"weapon_deagle")
        
cs_set_user_bpammo(id,CSW_DEAGLE,200)
        
set_hudmessage(50255)
        
show_hudmessage(0,"You have choose shoot for shoot.")  
    }




is it good ?

OneMoreLevel 10-21-2009 14:13

Re: help lastmenu
 
You missed the parameters on it.
PHP Code:

 switch(key)
{
    case 
1:
    {
        if( 
is_user_alive(id) )
            
give_item(id"weapon_knife");
        
set_user_health(id100);
        
set_hudmessage(50255)
        
//disarm all
        
strip_user_weapons(id)    
        
show_hudmessage(0,"You have chosen knife duel.")  
    }
    case 
2:
    {
        if( 
is_user_alive(id) )
            
//disarm team 
        
strip_user_weapons (id)  
        
// they delay them has 100hp as well as a deagle 
        
set_user_health(id100);
        
give_item(id,"weapon_deagle")
        
cs_set_user_bpammo(id,CSW_DEAGLE,200)
        
set_hudmessage(50255)
        
show_hudmessage(0,"You have chosen shoot for shoot.")  
    } 

See how I included (id) after strip_user_weapons.

Also, I dont know if the rest of your code will work. Youll need to wait for someone else to answer that :cry:

grimvh2 10-21-2009 14:15

Re: help lastmenu
 
Menu Tutorial

spirit 10-21-2009 14:16

Re: help lastmenu
 
maybe because i'm noob in coding.

grimvh2 in your tutorial don't have time for answer

Arkshine 10-21-2009 14:52

Re: help lastmenu
 
Quote:

maybe because i'm noob in coding.
It sounds like a joke. There are numerous threads in the french section where we said you to learn the basics stuffs before trying to manage advanced stuffs. And now you say that "maybe" you are a noob. Are you idiot ?


All times are GMT -4. The time now is 17:36.

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