rusikcrasava | Дата: Среда, 24.04.2013, 20:43 | Сообщение # 1 |
Мимо проходил
Группа: Пользователь
Сообщений: 1
Репутация: 0
Статус: Offline
| Помогите сделать определенное количество возраждения в супервип плагине. В нём стоит просто возраждение бесконечное количество раз а я хочу сделать чтобы 3 раза за раунд было. Код [spoiler]#include <amxmodx> #include <amxmisc> #include <hamsandwich> #include <cstrike> #include <fun> #include <engine> #include <fakemeta> #include <colorchat>
new bool:g_wea[33] new bool:g_godmode[33] new bool:g_noclip[33] new bool:g_grava[33] new bool:g_vip[33] new health[33] new grenade[33] new money[33] new team[33] new Speed, Gravity; #define NAME"ADMIN menu" #define VERSION"2.3" #define AUTHOR "BlackSmoke" // register button const KEYSMENU = MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|MENU_KEY_9|MENU_KEY_0 public plugin_init() { register_plugin(NAME, VERSION, AUTHOR) register_clcmd("adminmenu", "menuser") // <-- register clcmd register_clcmd("vipchangeteam", "teams") // <-- register clcmd register_clcmd("vipmenu", "vipmenu") register_concmd("revive", "respawn") // <-- register clcmd register_event("ResetHUD","startround","be") register_event("30", "ChangeMap", "a") Speed = register_cvar("Speed", "") Gravity = register_cvar("Gravity", "") RegisterHam( Ham_Spawn, "player", "Ham_Player_Spawn", 1 ) RegisterHam( Ham_Killed, "player", "Ham_Player_Killed", 1 ) register_menu("Menu 1", KEYSMENU, "menus2") // <-- register func register_menu("Vipmenu", KEYSMENU, "vipka")
register_dictionary("adminmenu.txt") }
public plugin_cfg() { new configsdir[128] get_localinfo("amxx_configsdir", configsdir, 127) return server_cmd("exec %s/AdminMenu.cfg", configsdir) }
public client_authorized(id) { client_cmd(id, "bind ^"f5^" ^"adminmenu^"") g_vip [id]= false }
public ChangeMap(id) { team [id]= 0 }
public startround(id) { grenade [id]= 0 health [id]= 0 money [id]= 0 }
public teams(id) { cs_set_user_team(id, 1) ExecuteHam(Ham_CS_RoundRespawn, id) return PLUGIN_HANDLED }
public respawn(id) { if(get_user_flags(id) & ADMIN_LEVEL_B) { ExecuteHam(Ham_CS_RoundRespawn, id); g_wea [id]= false g_godmode [id]= false g_noclip [id]= false g_grava [id]= false g_vip [id]= false } else { client_cmd(id, "") } return PLUGIN_HANDLED }
public Ham_Player_Spawn(id) { if (get_user_flags(id) & ADMIN_LEVEL_H) { new CsTeams:userTeam = cs_get_user_team(id) if (userTeam == CS_TEAM_T) { cs_set_user_model(id, "moroz.mdl") } else if(userTeam == CS_TEAM_CT) { cs_set_user_model(id, "moroz.mdl") } else { cs_reset_user_model(id) }
if(!g_vip[id]) if ( get_user_team ( id ) & 2 ) if (get_user_flags(id) & ADMIN_LEVEL_H) { message_begin(MSG_ALL, get_user_msgid("ScoreAttrib")) write_byte(id) write_byte(4) message_end() give_item(id,"weapon_usp") cs_set_user_bpammo(id, CSW_USP, 250) give_item(id,"weapon_elite") cs_set_user_bpammo(id, CSW_ELITE, 250) give_item(id,"weapon_hegrenade") give_item(id,"weapon_smokegrenade") give_item(id,"item_assaultsuit") g_vip [id]= false } else { client_cmd(id, "say ") g_vip [id]= true } g_wea [id]= false g_godmode [id]= false g_noclip [id]= false g_grava [id]= false g_vip [id]= false } }
public Ham_Player_Killed(id) { if(get_user_flags(id) & ADMIN_LEVEL_B) { g_wea [id]= false g_godmode [id]= false g_noclip [id]= false g_grava [id]= false } }
public menuser(id) { static menu[650], iLen iLen = 0 if(get_user_flags(id) & ADMIN_LEVEL_H) if(get_user_flags(id) & ADMIN_LEVEL_B) if(get_user_flags(id) & ADMIN_IMMUNITY) { iLen = formatex(menu[iLen], charsmax(menu) - iLen, "%L", LANG_PLAYER, "NAME_ADMIN"); } else { iLen = formatex(menu[iLen], charsmax(menu) - iLen, "%L", LANG_PLAYER, "NAME_LEG_ADMIN"); } else { iLen = formatex(menu[iLen], charsmax(menu) - iLen, "%L", LANG_PLAYER, "NAME_VIP"); } else { iLen = formatex(menu[iLen], charsmax(menu) - iLen, "%L", LANG_PLAYER, "NAME"); } if(get_user_flags(id) & ADMIN_IMMUNITY) if(!g_wea[id]) { iLen += formatex(menu[iLen], charsmax(menu) - iLen, "%L", LANG_PLAYER, "MENU_ITEMS_1_1"); } else { iLen += formatex(menu[iLen], charsmax(menu) - iLen, "%L", LANG_PLAYER, "MENU_ITEMS_1_2"); } else { iLen += formatex(menu[iLen], charsmax(menu) - iLen, "%L", LANG_PLAYER, "MENU_ITEMS_1_3"); } if(get_user_flags(id) & ADMIN_LEVEL_B) if(!g_grava[id]) { iLen += formatex(menu[iLen], charsmax(menu) - iLen, "%L", LANG_PLAYER, "MENU_ITEMS_2_1"); } else { iLen += formatex(menu[iLen], charsmax(menu) - iLen, "%L", LANG_PLAYER, "MENU_ITEMS_2_2"); } else { iLen += formatex(menu[iLen], charsmax(menu) - iLen, "%L", LANG_PLAYER, "MENU_ITEMS_2_3"); } if(get_user_team(id) & 2) if(get_user_flags(id) & ADMIN_LEVEL_B) { iLen += formatex(menu[iLen], charsmax(menu) - iLen, "%L", LANG_PLAYER, "MENU_ITEMS_3"); } else { iLen += formatex(menu[iLen], charsmax(menu) - iLen, "%L", LANG_PLAYER, "MENU_ITEMS_3_1"); } else { iLen += formatex(menu[iLen], charsmax(menu) - iLen, "%L", LANG_PLAYER, "MENU_ITEMS_3_1"); } if(get_user_flags(id) & ADMIN_LEVEL_B) if(get_user_team(id) & 2) { iLen += formatex(menu[iLen], charsmax(menu) - iLen, "%L", LANG_PLAYER, "MENU_ITEMS_4_1"); } else { iLen += formatex(menu[iLen], charsmax(menu) - iLen, "%L", LANG_PLAYER, "MENU_ITEMS_4_2"); } else { iLen += formatex(menu[iLen], charsmax(menu) - iLen, "%L", LANG_PLAYER, "MENU_ITEMS_4_3"); } if(get_user_flags(id) & ADMIN_IMMUNITY) if(!g_noclip[id]) { iLen += formatex(menu[iLen], charsmax(menu) - iLen, "%L", LANG_PLAYER, "MENU_ITEMS_5_1"); } else { iLen += formatex(menu[iLen], charsmax(menu) - iLen, "%L", LANG_PLAYER, "MENU_ITEMS_5_2"); } else { iLen += formatex(menu[iLen], charsmax(menu) - iLen, "%L", LANG_PLAYER, "MENU_ITEMS_5_3"); } if(get_user_flags(id) & ADMIN_IMMUNITY) if(!g_godmode[id]) { iLen += formatex(menu[iLen], charsmax(menu) - iLen, "%L", LANG_PLAYER, "MENU_ITEMS_6_1"); } else { iLen += formatex(menu[iLen], charsmax(menu) - iLen, "%L", LANG_PLAYER, "MENU_ITEMS_6_2"); } else { iLen += formatex(menu[iLen], charsmax(menu) - iLen, "%L", LANG_PLAYER, "MENU_ITEMS_6_3"); } if(get_user_flags(id) & ADMIN_LEVEL_B) { iLen += formatex(menu[iLen], charsmax(menu) - iLen, "%L", LANG_PLAYER, "MENU_ITEMS_7_1"); } else { iLen += formatex(menu[iLen], charsmax(menu) - iLen, "%L", LANG_PLAYER, "MENU_ITEMS_7_2"); } iLen += formatex(menu[iLen], charsmax(menu) - iLen, ""); iLen += formatex(menu[iLen], charsmax(menu) - iLen, "%L", LANG_PLAYER, "MENU_NEXTS"); iLen += formatex(menu[iLen], charsmax(menu) - iLen, "%L", LANG_PLAYER, "MENU_EXITS"); show_menu(id, KEYSMENU, menu, -1, "Menu 1");
return PLUGIN_HANDLED } public menus2(id, key) { switch(key) { case 0: { if(get_user_flags(id) & ADMIN_IMMUNITY) if(g_wea[id]) { strip_user_weapons(id)
give_item(id, "weapon_knife") client_cmd(id, "adminmenu") g_wea [id]= false } else { strip_user_weapons(id)
give_item(id, "weapon_ak47") cs_set_user_bpammo(id, CSW_AK47, 250) give_item(id, "weapon_knife") give_item(id, "weapon_m4a1") cs_set_user_bpammo(id, CSW_M4A1, 250) give_item(id, "weapon_deagle") cs_set_user_bpammo(id, CSW_DEAGLE, 250) give_item(id,"weapon_hegrenade") give_item(id,"weapon_smokegrenade") give_item(id,"weapon_flashbang") give_item(id,"item_assaultsuit") g_wea [id]= true client_cmd(id, "adminmenu") } else { client_cmd(id, "adminmenu") } }
case 1: { if(get_user_flags(id) & ADMIN_LEVEL_B) if(g_grava[id]) { set_user_gravity(id, 1.0) client_cmd(id, "adminmenu") g_grava [id]= false } else { set_user_gravity(id, get_pcvar_float( Gravity)); client_cmd(id, "adminmenu") g_grava [id]= true } else { client_cmd(id, "adminmenu") } }
case 2: { if(get_user_team(id) & 2) if(get_user_flags(id) & ADMIN_SLAY) { client_cmd(id, "revive") client_cmd(id, "adminmenu") } else { client_cmd(id, "adminmenu") } else { client_cmd(id, "adminmenu") } } case 3: { if(get_user_flags(id) & ADMIN_LEVEL_B) if(get_user_team(id) & 2) { cs_set_user_team(id, 1) client_cmd(id, "adminmenu") } else { cs_set_user_team(id, 2) client_cmd(id, "adminmenu") } else { client_cmd(id, "adminmenu") } }
case 4: { if(get_user_flags(id) & ADMIN_IMMUNITY) if(g_noclip[id]) { set_user_noclip(id, 0) client_cmd(id, "adminmenu") g_noclip [id]= false } else { set_user_noclip(id, 1) client_cmd(id, "adminmenu") g_noclip [id]= true } else { client_cmd(id, "adminmenu") } }
case 5: { if(get_user_flags(id) & ADMIN_IMMUNITY) if(g_godmode[id]) { set_user_godmode(id, 0) client_cmd(id, "adminmenu") g_godmode [id]= false } else { set_user_godmode(id, 1) client_cmd(id, "adminmenu") g_godmode [id]= true } else { client_cmd(id, "adminmenu") } }
case 6: { if(get_user_flags(id) & ADMIN_LEVEL_B) { client_cmd(id, "amxmodmenu") } else { client_cmd(id, "adminmenu") } }
case 7: { client_cmd(id, "") }
case 8: { client_cmd(id, "vipmenu") } } }
public vipmenu(id) { if(get_user_flags(id) & ADMIN_LEVEL_H) { static menu[650], iLen iLen = 0
iLen = formatex(menu[iLen], charsmax(menu) - iLen, "%L", LANG_PLAYER, "NAME_VIPMENU"); iLen += formatex(menu[iLen], charsmax(menu) - iLen, "%L", LANG_PLAYER, "VIPITEMS_1"); iLen += formatex(menu[iLen], charsmax(menu) - iLen, "%L", LANG_PLAYER, "VIPITEMS_2"); iLen += formatex(menu[iLen], charsmax(menu) - iLen, "%L", LANG_PLAYER, "VIPITEMS_3"); iLen += formatex(menu[iLen], charsmax(menu) - iLen, "%L", LANG_PLAYER, "VIPITEMS_4"); iLen += formatex(menu[iLen], charsmax(menu) - iLen, "%L", LANG_PLAYER, "VIPITEMS_5"); iLen += formatex(menu[iLen], charsmax(menu) - iLen, ""); iLen += formatex(menu[iLen], charsmax(menu) - iLen, ""); iLen += formatex(menu[iLen], charsmax(menu) - iLen, ""); iLen += formatex(menu[iLen], charsmax(menu) - iLen, "%L", LANG_PLAYER, "MENU_BACKS"); iLen += formatex(menu[iLen], charsmax(menu) - iLen, "%L", LANG_PLAYER, "MENU_EXITS"); show_menu(id, KEYSMENU, menu, -1, "Vipmenu"); } else { ColorChat(id, GREEN, "%L", LANG_PLAYER, "VIP_NOT") client_print(id, print_console, "РўС‹ РЅРµ [V I P]") }
return PLUGIN_HANDLED }
public vipka(id, key) { switch(key) { case 0: { if(grenade [id]< 1) { give_item(id, "weapon_hegrenade") give_item(id, "weapon_flashbang") give_item(id, "weapon_smokegrenade") client_cmd(id, "vipmenu") grenade[id]++ } else { client_cmd(id, "vipmenu") ColorChat(id, GREEN, "%L", LANG_PLAYER, "1_RAZ") } }
case 1: { set_user_maxspeed(id, get_pcvar_float( Speed)); client_cmd(id, "vipmenu") }
case 2: { if(health [id]< 1) { set_user_health(id, get_user_health(id) + 20) set_user_armor(id, get_user_armor(id) + 20) client_cmd(id, "vipmenu") health[id]++ } else { client_cmd(id, "vipmenu") ColorChat(id, GREEN, "%L", LANG_PLAYER, "1_RAZ") } }
case 3: { if(money [id]< 1) { cs_set_user_money(id, cs_get_user_money(id) + 2500) client_cmd(id, "vipmenu") money[id]++ } else { client_cmd(id, "vipmenu") ColorChat(id, GREEN, "%L", LANG_PLAYER, "1_RAZ") } }
case 4: { if(team [id]< 1) { client_cmd(id, "vipchangeteam") team[id]++ } else { client_cmd(id, "vipmenu") ColorChat(id, GREEN, "%L", LANG_PLAYER, "1_RAZ_MAP") } }
case 5: { client_cmd(id, "") }
case 6: { client_cmd(id, "") }
case 7: { client_cmd(id, "") }
case 8: { client_cmd(id, "adminmenu") } } return PLUGIN_HANDLED }[/spoiler]
Сообщение отредактировал rusikcrasava - Среда, 24.04.2013, 20:43 |
|
| |