terrorist if say /duel
duel menu to choose duel --> usp --> player menu choose --> mousesplash
prin_chat = TERRORIST is duel usp a mousesplash - start!!!
---------------------------------------------------------------------------
terrorist if say /duel
prin_chat = You Are In Combat!!!
---------------------------------------------------------------------------
more later...
prin_chat = TERRORIST IS WON THE DUEL
---------------------------------------------------------------------------
Terrorist > say /duel - Again
duel menu to choose duel --> usp --> player menu choose --> OTHER-PLAYER
prin_chat = TERRORIST is duel usp a mousesplash - start!!!
------------------------------------------------------------------------
code
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#include <hamsandwich>
#define PLUGIN "plugin"
#define VERSION "1.0"
#define AUTHOR "autor"
new g_iMaxPlayers
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
g_iMaxPlayers = get_maxplayers()
register_clcmd("say /duel" "duelo_menu")
RegisterHam(Ham_Killed, "player", "fw_PlayerKilled")
}
public duelo_menu(id)
{
if (cs_get_user_team(id) != CS_TEAM_T || !is_user_alive(id))
{
return PLUGIN_HANDLED;
}
new ctCount, trCount;
for (new i = 1; i <= g_iMaxPlayers; i++)
{
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) == 1 )
{
new duelomenu = menu_create("\yDuel:", "sub_duelo_menu")
menu_additem(duelomenu, "\w USP", "1", 0);
menu_setprop(duelomenu, MPROP_EXIT, MEXIT_ALL);
menu_display(id, duelomenu, 0);
}
return PLUGIN_HANDLED;
}
public sub_duelo_menu(id, duelomenu, item)
{
if (item == MENU_EXIT)
{
menu_destroy(duelomenu);
return PLUGIN_HANDLED;
}
new Data[6], Name[64];
new Access, Callback;
menu_item_getinfo(duelomenu, item, Access, Data,5, Name, 63, Callback);
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("\yChoose The Player:", "submenu3");
new players[32], pnum, tempid;
new szName[32], szTempid[10];
get_players(players, pnum, "a");
for( new i; i<pnum; i++ )
{
tempid = players[i];
if (cs_get_user_team(tempid) != CS_TEAM_CT)
{
continue;
}
get_user_name(tempid, szName, 31);
num_to_str(tempid, szTempid, 9);
menu_additem(menu, szName, szTempid, 0);
}
menu_display(id, menu);
return PLUGIN_HANDLED;
}
public submenu3(id, menu, item)
{
if( item == MENU_EXIT )
{
menu_destroy(menu);
return PLUGIN_HANDLED;
}
new data[6], iName[64];
new access, callback;
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
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(tempid, 100);
strip_user_weapons(id);
set_user_health(id, 100);
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(id, szName, 31);
get_user_name(tempid, szName2, 31);
set_hudmessage( 0, 50, 110, -1.0, 0.40, 2, 5.0, 8.0, 0.0, 0.0, 10);
show_hudmessage(0, "%s Reto A %s^n a un duelot", szName, szName2);
menu_destroy(menu);
return PLUGIN_HANDLED;
}
public fw_PlayerKilled(victim, attacker, shouldgib)
{
static namevictim[33]
get_user_name(victim, namevictim, 32)
new aName[32]
get_user_name(attacker, aName, sizeof(aName)-1)
if(get_user_team(attacker) == 1)
client_print(0, print_chat, "%s kill a %s",aName,namevictim)
client_print(attacker, print_chat, "You Kill a %s",namevictim)
}