| 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(PLUGIN, VERSION, AUTHOR) 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 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("\yDuelo:", "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("\yEscoje A Tu Contrincante:", "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; }
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
|