Raised This Month: $ Target: $400
 0% 

Need Some Codes


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DoviuX
Senior Member
Join Date: Jun 2009
Location: Lithuania
Old 10-24-2009 , 10:24   Need Some Codes
Reply With Quote #1

what is the code for slay and code for select a player in menu ?
DoviuX is offline
Send a message via Skype™ to DoviuX
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 10-24-2009 , 10:43   Re: Need Some Codes
Reply With Quote #2

user_kill
__________________
xPaw is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 10-24-2009 , 12:30   Re: Need Some Codes
Reply With Quote #3

You need to write up a menu:

PHP Code:
#include <amxmodx>

new gMaxPlayers

public plugin_init()
    
gMaxPlayers get_maxplayers()

public 
plugin_cfg()
    
register_clcmd"selectplayer""CmdSelectPlayer" )

public 
CmdSelectPlayerid )
{
    new 
menu menu_create"Select a Player""MenuSelectPlayer" )
    
    for ( new 
1name[33], idStr[3]; <= gMaxPlayersi++ )
        if ( 
!= id && is_user_connected) )
        {
            
get_user_nameiname32 )
            
num_to_striidStr)
            
            
menu_additemmenunameidStr )
        }
        
    
menu_displayidmenu )
}

public 
MenuSelectPlayeridmenuitem )
{
    if ( 
item == MENU_EXIT )
        goto 
end
    
    
new idStr[3], garbage
    menu_item_getinfo
menuitemgarbageidStr2__garbage )
    
    new 
player str_to_numidStr )
    
// In case they left before you selected them.
    
if ( !is_user_connectedplayer ) )
        goto 
end
    
    
// player is now your selected player
    // add your code here
    
end:
    
menu_destroymenu )
    return 
PLUGIN_HANDLED

__________________
Hawk552 is offline
Send a message via AIM to Hawk552
MaNuCs
BANNED
Join Date: Oct 2009
Location: Venezuela
Old 10-24-2009 , 15:43   Re: Need Some Codes
Reply With Quote #4

hawk... ur code is good and i use...
but... i have 1 problem
1 select the player and the COMMAND(agree for me) is use in me and he no...

i need the command is use in me and he....
need to the menu open for the last terrorist... and in the menu players... show CTS PLAYERS LIVEs..

i give +karm

thx

this is my code...

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fun>

new Plugin[] = "Last Restquest Menu"
new Version[] =  "1.0"
new Author[] = "[M]aNuC[s]_"
new gMaxPlayers


public plugin_init()
{
    
register_clcmd"say /lr","MenuLR");
    
register_clcmd"say !lr","MenuLR");
    
gMaxPlayers get_maxplayers() 
}

public 
MenuLR(id

    if(
is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_T
        
{
    new 
Menu menu_create("\w Last Resquest:""mostrar_menu")
    
menu_additem(Menu"\w Khife Duel"        "1"0)
    
menu_additem(Menu"\w Shot For Shot"        "2"0
    
    
menu_setprop(Menu,MPROP_EXITNAME,"Salir"
    
menu_setprop(MenuMPROP_EXITMEXIT_ALL
    
    
menu_display(idMenu0
}

}
public 
mostrar_menu(idMenuitem

if (
item == MENU_EXIT

    
menu_destroy(Menu
    return 
PLUGIN_HANDLED 


new 
iData[6]; 
new 
iAccess
new 
iCallback
new 
iName[64]; 
menu_item_getinfo(MenuitemiAccessiData5iName63iCallback

switch (
str_to_num(iData)) 

    case 
1:
    {
        if( 
is_user_alive(id) )
        {
        
Cuchilloid )
        }
    }
    case 
2:
    {
        if( 
is_user_alive(id) )
        {
        
Pistola(id)
        }  
    }
}
}

public 
Cuchilloid )
{
    new 
menu menu_create"Select a Player""MenuSelectPlayer1" )
    
    for ( new 
1name[33], idStr[3]; <= gMaxPlayersi++ )
        if ( 
!= id && is_user_connected) )
        {
            
get_user_nameiname32 )
            
num_to_striidStr)
            
            
menu_additemmenunameidStr )
        }
        
    
menu_displayidmenu )


public 
MenuSelectPlayer1idmenuitem )
{
    if ( 
item == MENU_EXIT )
        goto 
end
    
    
new idStr[3], garbage
    menu_item_getinfo
menuitemgarbageidStr2__garbage )
    
    new 
player str_to_numidStr )
    if ( !
is_user_connectedplayer ) )
        goto 
end
    
        strip_user_weapons
(id)  
        
give_item(id"weapon_knife");
        
set_user_health(id100);
        
client_print(idprint_chat"Duel Khife Activado...")
end:
    
menu_destroymenu )
    return 
PLUGIN_HANDLED
}

public 
Pistolaid )
{
    new 
menu menu_create"Select a Player""MenuSelectPlayer2" )
    
    for ( new 
1name[33], idStr[3]; <= gMaxPlayersi++ )
        if ( 
!= id && is_user_connected) )
        {
            
get_user_nameiname32 )
            
num_to_striidStr)
            
            
menu_additemmenunameidStr )
        }
        
    
menu_displayidmenu )


public 
MenuSelectPlayer2idmenuitem )
{
    if ( 
item == MENU_EXIT )
        goto 
end
    
    
new idStr[3], garbage
    menu_item_getinfo
menuitemgarbageidStr2__garbage )
    
    new 
player str_to_numidStr )
    if ( !
is_user_connectedplayer ) )
        goto 
end
    
           strip_user_weapons 
(id)  
            
set_user_health(id100);
            
give_item(id,"weapon_deagle")
            
cs_set_user_bpammo(id,CSW_DEAGLE,200)
            
give_item(id"weapon_knife")
            
client_print(idprint_chat"Shot For Shot Activado...")
end:
    
menu_destroymenu )
    return 
PLUGIN_HANDLED


Last edited by MaNuCs; 10-24-2009 at 16:12.
MaNuCs is offline
Send a message via MSN to MaNuCs
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 10-24-2009 , 16:59   Re: Need Some Codes
Reply With Quote #5

PHP Code:
// Last terrorist Check
new players[32], pnum;
get_players(playerspnum,"ae""TERRORIST");

if(
pnum == 1)
{
    
// 1 terrorist alive
}

// If you want it automaticly
register_event("DeathMsg",         "DeathMsg""a"); // add to plugins init

public DeathMsg()
{
    new 
Victim read_data(2)
    if(
get_user_team(Victim) == 1)
    {
        new 
players[32], pnum;
        
get_players(playerspnum,"ae""TERRORIST");

        if(
pnum == 1)
        {
            
// 1 terrorist alive
        
}
    }
}
    
// add only cts in your menu
new players[32], pnumplayerszplayer[10];
get_players(playerspnum);
    
name[32]
    
for( new 
ii<pnumi++ )
{
        
player players[i]
        
get_user_name(player,name,31)
        
num_to_str(playerszplayer9);
        
menu_additem(menunameszplayer0);
}

// to handle it
new data[6], iName[64];
new 
accesscallback;
menu_item_getinfo(menuitemaccessdata,5iName63callback);
    
new 
player str_to_num(data); 
__________________
I am out of order!

Last edited by grimvh2; 10-24-2009 at 17:05.
grimvh2 is offline
MaNuCs
BANNED
Join Date: Oct 2009
Location: Venezuela
Old 10-25-2009 , 13:36   Re: Need Some Codes
Reply With Quote #6

PHP Code:
 if(pnum == 1)
{
    
// 1 terrorist alive <------------- (What Code Its Here?!)
}

public 
DeathMsg()
{
    new 
Victim read_data(2)
    if(
get_user_team(Victim) == 1)
    {
        new 
players[32], pnum;
        
get_players(playerspnum,"ae""TERRORIST");

        if(
pnum == 1)
        {
               
// 1 terrorist alive <------------ (What Code Its Here?!)
        
}
    }
}
    
// add only cts in your menu
new players[32], pnumplayerszplayer[10];
get_players(playerspnum);
    
name[32]  // <----------------- ( i have errors in this line Help Pls!) 
    
for( new ii<pnumi++ )
{
        
player players[i]
        
get_user_name(player,name,31)
        
num_to_str(playerszplayer9);
        
menu_additem(menunameszplayer0);

thx for all

Last edited by MaNuCs; 10-25-2009 at 13:41.
MaNuCs is offline
Send a message via MSN to MaNuCs
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:38.


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