Raised This Month: $ Target: $400
 0% 

help lastmenu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
spirit
Senior Member
Join Date: Jul 2009
Location: Quimper
Old 10-21-2009 , 13:52   help lastmenu
Reply With Quote #1

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.

Last edited by spirit; 10-25-2009 at 12:32.
spirit is offline
OneMoreLevel
Senior Member
Join Date: Aug 2009
Location: Look behind you... Very
Old 10-21-2009 , 13:55   Re: help lastmenu
Reply With Quote #2

Use strip_user_weapons instead of all those client_cmds . That is one problem.
__________________
60/100 60%
[||||||||||||||||||||]
Project: Warfighter mod
Blog:
http://sites.google.com/site/dailymultitasker/
PHP Code:
   if ( i_help_you "Yes" ) == )
    
set_user_karma(onemorelevel,add,+1
OneMoreLevel is offline
spirit
Senior Member
Join Date: Jul 2009
Location: Quimper
Old 10-21-2009 , 14:03   Re: help lastmenu
Reply With Quote #3

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 ?
spirit is offline
OneMoreLevel
Senior Member
Join Date: Aug 2009
Location: Look behind you... Very
Old 10-21-2009 , 14:13   Re: help lastmenu
Reply With Quote #4

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
__________________
60/100 60%
[||||||||||||||||||||]
Project: Warfighter mod
Blog:
http://sites.google.com/site/dailymultitasker/
PHP Code:
   if ( i_help_you "Yes" ) == )
    
set_user_karma(onemorelevel,add,+1
OneMoreLevel is offline
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 10-21-2009 , 14:15   Re: help lastmenu
Reply With Quote #5

Menu Tutorial
__________________
I am out of order!
grimvh2 is offline
spirit
Senior Member
Join Date: Jul 2009
Location: Quimper
Old 10-21-2009 , 14:16   Re: help lastmenu
Reply With Quote #6

maybe because i'm noob in coding.

grimvh2 in your tutorial don't have time for answer

Last edited by spirit; 10-21-2009 at 14:19.
spirit is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-21-2009 , 14:52   Re: help lastmenu
Reply With Quote #7

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 ?
__________________
Arkshine 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 17:36.


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