1.Vreau ca "/vm" sa nu poata fii folosit de zombi.. (nici dupa infectie,exemplu:Sunt Human(ct) si dupa ce un zm m-a infectat sa nu mai am acces la /vm...
2.Bug la speed.Dupa ce cumpar speed..si schimb arma nu mai e.
3.Invizibilitate.. Sa fie cam 80% ( sa o cumpueri. acuma ti-o da direct..)
Tot ce cumpar din /vm e doar pentru Human.. sa nu poti cumpara cand esti mort,sau zombi..Cam atat.Daca se poate sa faceti o calasa de zombi pentru vip..
- | Afiseaza codul
#include <amxmodx> #include <fun> #include <cstrike> #include <hamsandwich> #include <fakemeta> #include <engine> #include <biohazard> #pragma tabsize 0 #define ADMIN_ACCESS ADMIN_LEVEL_H #define is_user(%1) (1 <= %1 <= maxPlayers) #define HE_GRENADE (1<<0) #define SMOKE_GRENADE (1<<1) #define FLASH_GRENADE (1<<2) new gCvar_flags; new bool:has_ammo[33] new maxPlayers; new speed,gravity; new ciocan[33],arma[33]; new g_armura[33],g_hp[33],smk[33]; public plugin_init() { register_plugin("VIP", "1.0", "D3luxe") register_clcmd("say /vm", "open_vip") register_clcmd("say /vipmenu", "open_vip") register_clcmd("say /vips", "ShowVipsOnline", ADMIN_ALL, "Show Vips Online"); speed = register_cvar( "vipmenu_speed", "520.0" ) gravity = register_cvar( "vipmenu_gravity", "0.6" ) gCvar_flags = register_cvar("ammo_nade_flags" , "ac"); register_event("CurWeapon", "Event_CurWeapon", "be", "1=1") register_event("CurWeapon" , "event_CurWeapon" , "be" , "1=1"); register_event("ResetHUD", "resetModel", "b") RegisterHam(Ham_Spawn, "player", "Spawn_player", 1) RegisterHam(Ham_TakeDamage, "player", "Player_TakeDamage") maxPlayers = get_maxplayers(); } public plugin_precache() { precache_model("models/arme/v_ciocan.mdl") precache_model("models/arme/p_ciocan.mdl") precache_model("models/arme/v_arma.mdl") precache_model("models/arme/p_arma.mdl") precache_model("models/player/vip/vip.mdl")//am pus asa pentru ca daca e server de zm nu are sens sa pui model cand playerul e zombie } public Spawn_player(id) { if(is_user_alive(id) && is_user_connected(id)) { set_user_rendering( id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 100 ) has_ammo[id] = false; g_armura[id] = false; g_hp[id] = false; smk[id] = false; ciocan[id] = 0; arma[id] = 0; } } public resetModel(id, level, cid) { if(is_user_vip(id)) { new CsTeams:userTeam = cs_get_user_team(id) if(userTeam == CS_TEAM_CT) { cs_set_user_model(id, "vip") } else { cs_reset_user_model(id) } } return PLUGIN_CONTINUE } public event_CurWeapon(id) { if(!(is_user_alive(id) && is_user_vip(id))) return PLUGIN_CONTINUE; if(has_ammo[id]) { static wpnid, clip; wpnid = read_data(2); clip = read_data(3); give_ammo(id , wpnid , clip); } return PLUGIN_CONTINUE; } public client_connect(id) { has_ammo[id] = false; if(task_exists(id)) remove_task(id); } public client_disconnect(id) { has_ammo[id] = false; if(task_exists(id)) remove_task(id); } bool:is_user_vip(id) { if(id < 0 || id > 32) return false if( !(get_user_flags(id) & ADMIN_ACCESS) ) return false return true } public VipStatus(const MsgId, const MsgType, const MsgDest) { static id; id = get_msg_arg_int(1); if(is_user_vip(id) && !get_msg_arg_int(2)) set_msg_arg_int(2, ARG_BYTE, (1 << 2 )); } public ShowVipsOnline(id) { new message[256], name[32], count = 0; new len = format(message, charsmax(message), "Vip-uri online: "); for (new player = 1; player <= maxPlayers; player++) { if (is_user_connected(player) && is_user_vip(player)) { get_user_name(player, name, charsmax(name)); if (count && len) { len += format(message[len], 255 - len, ", "); } len += format(message[len], 255 - len, "%s", name); if (len > 96) { client_print(id, print_chat, "%s", message); len = format(message, charsmax(message), ""); } count++; } } if (len) { if (!count) { len += format(message[len], 255 - len, "Nu este nici un vip online."); } client_print(id, print_chat, "%s", message); } return PLUGIN_HANDLED; } public Event_CurWeapon(player) { if(!(ciocan[player] || arma[player])) return PLUGIN_CONTINUE if(!is_user_vip(player) || !is_user_alive(player)) return PLUGIN_CONTINUE if(read_data(2) == CSW_KNIFE && ciocan[player] == 1) { set_pev(player, pev_viewmodel2, "models/arme/v_ciocan.mdl") set_pev(player, pev_weaponmodel2, "models/arme/p_ciocan.mdl") } if(read_data(2) == CSW_XM1014 && arma[player] == 1) { set_pev(player, pev_viewmodel2, "models/arme/v_arma.mdl") set_pev(player, pev_weaponmodel2, "models/arme/p_arma.mdl") } return PLUGIN_CONTINUE } public Player_TakeDamage(victim, inflicator, attacker, Float:damage, damage_type, bitsDamage) { if (!is_user(attacker) || !is_user(victim)) return; if(get_user_weapon(attacker) == CSW_KNIFE) { if(pev(attacker, pev_button) & IN_ATTACK && ciocan[attacker] == 1) { user_slap(victim,0,0) user_slap(victim,0,0) user_slap(victim,0,0) user_slap(victim,0,0) SetHamParamFloat(4, damage = 100.0) } else if(pev(attacker, pev_button) & IN_ATTACK2 && ciocan[attacker] == 1) { user_slap(victim,0,0) user_slap(victim,0,0) user_slap(victim,0,0) user_slap(victim,0,0) user_slap(victim,0,0) user_slap(victim,0,0) SetHamParamFloat(4, damage = 100.0) } } if(get_user_weapon(attacker) == CSW_XM1014 ) { if(pev(attacker, pev_button) & IN_ATTACK && arma[attacker] == 1) { SetHamParamFloat(4, damage = 170.0) } } } public abilitati(id) { if(!is_user_vip(id) || is_user_infected(id) || !is_user_alive(id)) { ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL!y deoarece nu esti VIP sau nu esti HUMAN!") return PLUGIN_HANDLED } else if(get_user_team(id) == 2 || !is_user_infected(id) ) { new menu = menu_create( "\r[BIO.MAX-CS.RO] \yVIP \yMENU", "abilitati_handler" ); menu_additem(menu, "\yInvizibilitate \r[80%inv.]", "1", 0); menu_additem(menu, "\y250 \rHp", "2", 0); menu_additem(menu, "\y150 \rAp", "3", 0); menu_additem(menu, "\ySpeed", "4", 0); menu_additem(menu, "\yGravity", "5", 0); menu_additem(menu, "\yAmmo Infinit \r[1 runda]", "6", 0); menu_setprop( menu, MPROP_EXITNAME, "Exit") menu_display( id, menu, 0); } return PLUGIN_CONTINUE; } public abilitati_handler(id, menu, item, client) { if(item == MENU_EXIT || !is_user_alive(id)) { menu_destroy(menu) return PLUGIN_HANDLED } static data[6], name[64], acs, cllbck, key menu_item_getinfo(menu, item, acs, data, 5, name, 63, cllbck) key = str_to_num(data) switch(key) { case 1: { if(is_user_alive(id)) { set_user_rendering( id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 20 ) ChatColor(id, "!g[VIP] !yAi ales !teamInvizibilitate[80% invizibilitate]!") }else { ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!") } } case 2: { if(g_hp[id]) { ChatColor(id, "!g[VIP]!yAi !teamluat deja 250 hp!yrunda asta.") }else if(is_user_alive(id)) { set_user_health(id, 250) g_hp[id] = true; ChatColor(id, "!g[VIP]!yAi ales !team250 hp!") } else { ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!") } } case 3: { if(g_armura[id]) { ChatColor(id, "!g[VIP]!yAi !teamluat deja 150 armura !yrunda asta!") }else if(is_user_alive(id)) { set_user_armor(id,150) g_armura[id] = true; ChatColor(id, "!g[VIP]!yAi ales !team150 armura!") } else { ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!") } } case 4: { if(is_user_alive(id)) { set_user_maxspeed(id, get_pcvar_float(speed)) ChatColor(id, "!g[VIP] !yAi ales !teamSpeed!") } else { ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!") } } case 5: { if(is_user_alive(id)) { set_user_gravity(id, get_pcvar_float(gravity)) ChatColor(id, "!g[VIP] !yAi ales !teamGravity !") } else { ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!") } } case 6: { if(is_user_alive(id)) { has_ammo[id] = true; ChatColor(id, "!g[VIP] !yAi ales !teamInfinite Ammo pentru o runda!") }else { ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!") } } } menu_destroy(menu) return PLUGIN_HANDLED } public open_vip(id) { if(!is_user_vip(id) || is_user_infected(id) || !is_user_alive(id)) { ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL!y deoarece nu esti VIP sau nu esti HUMAN!") return PLUGIN_HANDLED } else if(get_user_team(id) == 2 || !is_user_infected(id)) { new menu = menu_create( "\r[BIO.MAX-CS.RO] \yVIP \yMENU", "vip_handler" ); menu_additem(menu, "\yCiocan \yAruncator \r[Slap]", "1", 0); menu_additem(menu, "\yAbilitati", "2", 0); menu_additem(menu, "\ySmoke \yGrenade", "3", 0); menu_additem(menu, "\yMX1014", "4", 0); menu_setprop( menu, MPROP_EXITNAME, "Exit") menu_display( id, menu, 0); } return PLUGIN_CONTINUE; } public vip_handler(id, menu, item, client) { if(item == MENU_EXIT || !is_user_alive(id)) { menu_destroy(menu) return PLUGIN_HANDLED } static data[6], name[64], acs, cllbck, key menu_item_getinfo(menu, item, acs, data, 5, name, 63, cllbck) key = str_to_num(data) switch(key) { case 1: { if(is_user_alive(id)) { engclient_cmd(id, "weapon_knife") ciocan[id] = 1 set_pev(id, pev_viewmodel2, "models/arme/v_ciocan.mdl") set_pev(id, pev_weaponmodel2, "models/arme/p_ciocan.mdl") ChatColor(id, "!g[VIP] !yAi ales !teamCiocan Aruncator!") } else { ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!") } } case 2: { if(is_user_alive(id)) { abilitati(id) ChatColor(id, "!g[VIP] !yAi deschis !teamMeniul de Abilitati !") } else { ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!") } } case 3: { if(smk[id]) { ChatColor(id, "!g[VIP] !yAi ales deja !teamSmoke Grenade!y runda asta!") } else if(is_user_alive(id)) { give_item(id, "weapon_smokegrenade") smk[id] = true; ChatColor(id, "!g[VIP] !yAi ales !teamSmoke Grenade!") } else { ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!") } } case 4: { if(is_user_alive(id)) { engclient_cmd(id, "weapon_xm1014") give_item(id, "weapon_xm1014") cs_set_user_bpammo(id, CSW_XM1014, 200) arma[id] = 1; set_pev(id, pev_viewmodel2, "models/arme/v_arma.mdl") set_pev(id, pev_weaponmodel2, "models/arme/p_arma.mdl") ChatColor(id, "!g[VIP] !yAi ales !teamarma xm1014!") } else { ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL VIP !ydeoarece esti MORT!") } } } menu_destroy(menu) return PLUGIN_HANDLED } //unlimited ammo public give_ammo(id , wpnid , clip) { if(!is_user_alive(id) && !is_user_vip(id) && has_ammo[id] != true ) return; if( wpnid==CSW_C4 || wpnid==CSW_KNIFE || wpnid==CSW_HEGRENADE || wpnid==CSW_SMOKEGRENADE || wpnid==CSW_FLASHBANG ) return; if(!clip) { static weapname[33]; get_weaponname(wpnid , weapname , 32); static wpn wpn = -1; while((wpn = find_ent_by_class(wpn , weapname)) != 0) { if(id == entity_get_edict(wpn , EV_ENT_owner)) { cs_set_weapon_ammo(wpn , maxclip(wpnid)) break; } } } } public check_for_nades(id) { if(!is_user_alive(id)) return; if(nade_flags() & HE_GRENADE) { if(!user_has_weapon(id , CSW_HEGRENADE)) give_item(id , "weapon_hegrenade"); } if(nade_flags() & SMOKE_GRENADE) { if(!user_has_weapon(id , CSW_SMOKEGRENADE)) give_item(id , "weapon_smokegrenade"); } if(nade_flags() & FLASH_GRENADE) { if(!user_has_weapon(id , CSW_FLASHBANG)) give_item(id , "weapon_flashbang"); } } stock maxclip(wpnid) { static ca; ca = 0; switch (wpnid) { case CSW_P228 : ca = 13; case CSW_SCOUT : ca = 10; case CSW_HEGRENADE : ca = 0; case CSW_XM1014 : ca = 7; case CSW_C4 : ca = 0; case CSW_MAC10 : ca = 30; case CSW_AUG : ca = 30; case CSW_SMOKEGRENADE : ca = 0; case CSW_ELITE : ca = 15; case CSW_FIVESEVEN : ca = 20; case CSW_UMP45 : ca = 25; case CSW_SG550 : ca = 30; case CSW_GALI : ca = 35; case CSW_FAMAS : ca = 25; case CSW_USP : ca = 12; case CSW_GLOCK18 : ca = 20; case CSW_AWP : ca = 10; case CSW_MP5NAVY : ca = 30; case CSW_M249 : ca = 100; case CSW_M3 : ca = 8; case CSW_M4A1 : ca = 30; case CSW_TMP : ca = 30; case CSW_G3SG1 : ca = 20; case CSW_FLASHBANG : ca = 0; case CSW_DEAGLE : ca = 7; case CSW_SG552 : ca = 30; case CSW_AK47 : ca = 30; case CSW_P90 : ca = 50; } return ca; } stock nade_flags() { static buffer[8]; get_pcvar_string(gCvar_flags , buffer , 7); return read_flags(buffer); } //stock stock ChatColor(const id, const input[], any:...) { new count = 1, players[32] static msg[191] vformat(msg, 190, input, 3) replace_all(msg, 190, "!g", "^4") replace_all(msg, 190, "!y", "^1") replace_all(msg, 190, "!team", "^3") if (id) players[0] = id; else get_players(players, count, "ch") { for (new i = 0; i < count; i++) { if (is_user_connected(players)) { message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players); write_byte(players); write_string(msg); message_end(); } } } } /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par } */