AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   duel menu + ham kiled ? :S (https://forums.alliedmods.net/showthread.php?t=113340)

MouseSplash! 12-25-2009 16:10

duel menu + ham kiled ? :S
 
PHP Code:

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

#define PLUGIN "plugin"
#define VERSION "1.0"
#define AUTHOR "autor"

new g_iMaxPlayers

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
g_iMaxPlayers get_maxplayers()
}

public 
duelo_menu(id)
{    
    if (
cs_get_user_team(id) != CS_TEAM_T || !is_user_alive(id))
    {
        return 
PLUGIN_HANDLED;
    }

    new 
ctCounttrCount;
    
    for (new 
1<= g_iMaxPlayersi++)
    {
        if (!
is_user_alive(i))
        {
            continue;
        }
        
        switch (
cs_get_user_team(i))
        {
            case 
CS_TEAM_CT:
            {
                
ctCount++;
            }
            
            case 
CS_TEAM_T:
            {
                
trCount++;
            }
        }
    }

    if (
trCount 1)
    {
        return 
PLUGIN_HANDLED;
    }
    
    if (
ctCount == 0)
    {
        return 
PLUGIN_HANDLED;
    }
    if(
get_user_team(id) == )
    {
        new 
duelomenu menu_create("\yDuelo:""sub_duelo_menu")
        
        
menu_additem(duelomenu"\w USP",     "1"0);

        
        
menu_setprop(duelomenuMPROP_EXITMEXIT_ALL);
        
menu_display(idduelomenu0);
    }

    return 
PLUGIN_HANDLED;
}

public 
sub_duelo_menu(idduelomenuitem)
{
    
    if (
item == MENU_EXIT)
    {
        
menu_destroy(duelomenu);
        return 
PLUGIN_HANDLED;
    }
    
    new 
Data[6], Name[64];
    new 
AccessCallback;
    
menu_item_getinfo(duelomenuitemAccessData,5Name63Callback);
        
    new 
Key str_to_num(Data);
    
    switch (
Key)
    {
        case 
1:
        {
            
Usp(id)
        }
    }

    
menu_destroy(duelomenu);

    return 
PLUGIN_HANDLED;
}

public 
Usp(id)
{
    new 
menu menu_create("\yEscoje A Tu Contrincante:""submenu3");
    
     new 
players[32], pnumtempid;
    new 
szName[32], szTempid[10];

    
get_players(playerspnum"a");

    for( new 
ii<pnumi++ )
    {
        
tempid players[i];
        
        if (
cs_get_user_team(tempid) != CS_TEAM_CT)
        {
            continue;
        }
        
        
get_user_name(tempidszName31);
        
num_to_str(tempidszTempid9);
        
menu_additem(menuszNameszTempid0);
    }
    
    
menu_display(idmenu);
    return 
PLUGIN_HANDLED;
}

public 
submenu3(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }

    new 
data[6], iName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,5iName63callback);

    new 
tempid str_to_num(data);
    
    
strip_user_weapons(tempid);
    
give_item(tempid"weapon_usp");
    
cs_set_user_bpammo(tempid,CSW_USP,12),
    
give_item(tempid"weapon_knife");
    
set_user_health(tempid100);
    
    
strip_user_weapons(id);
    
set_user_health(id100);
    
give_item(id"weapon_usp");
    
cs_set_user_bpammo(id,CSW_USP,12);
    
give_item(id"weapon_knife");
            
    new 
szName[32], szName2[32];
    
get_user_name(idszName31);
    
get_user_name(tempidszName231);
    
set_hudmessage050110, -1.00.4025.08.00.00.010);
    
show_hudmessage(0"%s Reto A %s^n a un duelot"szNameszName2);
        
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
 } 




help me to add:

- if terrorist open menu, cant open again, at the finishin duel.. he can open the menu again...


- the terrorist select the player and activate the opcion in ham_killed say the winner ex: mouse win the khife duel a splash... so turn off the opcion in the ham_killed, and turn on aagain is activate but this is finished turn off


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

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