Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Sublime AMXX Editor v2.2 */
- #include <amxmodx>
- #include <cstrike>
- #include <hamsandwich>
- #include <fakemeta_util>
- #include <fun>
- #include <vip>
- #pragma tabsize 0
- #pragma compress 1
- #define PLUGIN "VIP SYSTEM"
- #define VERSION "1.0"
- #define AUTHOR "deprale"
- new gMenu
- new Round = 0
- new g_hudmsg1, g_hudmsg2, g_hudmsg3
- new Three = 3
- public plugin_init()
- {
- register_plugin(PLUGIN, VERSION, AUTHOR)
- //VERIFICA DACA E JEGOASA MAPA
- set_task(1.0, "CheckMap")
- //HOOKS
- RegisterHam(Ham_Spawn, "player", "playerSpawn", 1)
- register_event("HLTV", "newRound", "a", "1=0", "2=0")
- register_event( "DeathMsg", "Event_Death", "a" )
- register_event("Damage", "on_damage", "b", "2!0", "3=0", "4!0")
- //MENIU JEGOS
- gMenu = menu_create("\rMeniu ARME(VIP) :", "handlerMenu")
- menu_additem(gMenu, "\wM4A1 + Deagle + Utilitati", "1")
- menu_additem(gMenu, "\wAK47 + Deagle + Utilitati", "2")
- menu_additem(gMenu, "\wAWP + Deagle + Utilitati", "3")
- //CHANNELURILE DE LA DAMAGE
- g_hudmsg1 = CreateHudSyncObj()
- g_hudmsg2 = CreateHudSyncObj()
- g_hudmsg3 = CreateHudSyncObj()
- }
- public CheckMap()
- {
- new MapName[32]
- get_mapname(MapName, charsmax(MapName))
- if(containi(MapName, "cs_") != -1 || containi(MapName, "awp_") != -1 || containi(MapName, "fy_") != -1 || containi(MapName, "2x2") != -1 || containi(MapName, "hp") != -1 )
- set_fail_state("[VIP SYSTEM] PLUGINUL S-A OPRIT DIN CAUZA CA HARTA E MICA/NE-POTRIVITA PENTRU PLUGIN.")
- return PLUGIN_HANDLED;
- }
- public newRound(id)
- {
- set_task(0.1, "setVip")
- if ( Round < Three )
- Round++
- }
- public on_damage(id)
- {
- static attacker; attacker = get_user_attacker(id)
- static damage; damage = read_data(2)
- if(is_user_connected(attacker))
- {
- if(fm_is_ent_visible(attacker,id) && !is_user_vip(attacker))
- {
- set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, 1)
- ShowSyncHudMsg(attacker, g_hudmsg1, "%i^n", damage)
- }
- else if(fm_is_ent_visible(attacker,id) && is_user_vip(attacker) )
- {
- set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, 2)
- ShowSyncHudMsg(attacker, g_hudmsg2, "%i^n", damage)
- }
- else if(!fm_is_ent_visible(attacker,id) && is_user_vip(attacker))
- {
- set_hudmessage(178, 34, 34, -1.0, 0.55, 0, 0.1, 1.0, 0.00, 0.00, 3)
- ShowSyncHudMsg(attacker, g_hudmsg3, "%i^n", damage)
- }
- }
- }
- public handlerMenu(id, menu, item)
- {
- if ( item == MENU_EXIT )
- {
- return PLUGIN_HANDLED;
- }
- switch(item)
- {
- case 0:
- {
- if(cs_get_user_team(id) == CS_TEAM_T && user_has_weapon(id, CSW_C4)) {
- fm_strip_user_weapons(id)
- give_item(id, "weapon_c4")
- }
- if(cs_get_user_team(id) == CS_TEAM_T && !user_has_weapon(id, CSW_C4))
- fm_strip_user_weapons(id)
- if(cs_get_user_team(id) == CS_TEAM_CT)
- fm_strip_user_weapons(id)
- cs_set_user_armor(id, 100, CsArmorType:2)
- give_item(id, "weapon_knife")
- cs_give_user_weapon(id, "weapon_deagle", CSW_DEAGLE, 35)
- cs_give_user_weapon(id, "weapon_m4a1", CSW_M4A1, 90)
- if(cs_get_user_team(id) == CS_TEAM_CT)
- give_item(id, "item_thighpack");
- give_item(id, "weapon_flashbang")
- give_item(id, "weapon_flashbang")
- give_item(id, "weapon_hegrenade")
- }
- case 1:
- {
- if(cs_get_user_team(id) == CS_TEAM_T && user_has_weapon(id, CSW_C4)) {
- fm_strip_user_weapons(id)
- give_item(id, "weapon_c4")
- }
- if(cs_get_user_team(id) == CS_TEAM_T && !user_has_weapon(id, CSW_C4))
- fm_strip_user_weapons(id)
- if(cs_get_user_team(id) == CS_TEAM_CT)
- fm_strip_user_weapons(id)
- cs_set_user_armor(id, 100, CsArmorType:2)
- give_item(id, "weapon_knife")
- cs_give_user_weapon(id, "weapon_deagle", CSW_DEAGLE, 35)
- cs_give_user_weapon(id, "weapon_ak47", CSW_AK47, 90)
- if(cs_get_user_team(id) == CS_TEAM_CT)
- give_item(id, "item_thighpack");
- give_item(id, "weapon_flashbang")
- give_item(id, "weapon_flashbang")
- give_item(id, "weapon_hegrenade")
- }
- case 2:
- {
- if(cs_get_user_team(id) == CS_TEAM_T && user_has_weapon(id, CSW_C4)) {
- fm_strip_user_weapons(id)
- give_item(id, "weapon_c4")
- }
- if(cs_get_user_team(id) == CS_TEAM_T && !user_has_weapon(id, CSW_C4))
- fm_strip_user_weapons(id)
- if(cs_get_user_team(id) == CS_TEAM_CT)
- fm_strip_user_weapons(id)
- cs_set_user_armor(id, 100, CsArmorType:2)
- give_item(id, "weapon_knife")
- cs_give_user_weapon(id, "weapon_deagle", CSW_DEAGLE, 35)
- cs_give_user_weapon(id, "weapon_awp", CSW_AWP, 30)
- if(cs_get_user_team(id) == CS_TEAM_CT)
- give_item(id, "item_thighpack");
- give_item(id, "weapon_flashbang")
- give_item(id, "weapon_flashbang")
- give_item(id, "weapon_hegrenade")
- }
- }
- return PLUGIN_HANDLED;
- }
- public vip_putinserver(id) {
- ShowMessage(id, "conectat");
- }
- public vip_disconnect(id) {
- ShowMessage(id, "deconectat");
- }
- ShowMessage(id, action[]) {
- // grab user's name
- new name[32];
- get_user_name(id, name, charsmax(name));
- set_hudmessage(0, 255, 0, 0.2, 0.6, .channel = -1);
- show_hudmessage(0, "[VIP] %s s-a %s!", name, action);
- }
- public playerSpawn(id) {
- if(is_user_alive(id) && is_user_vip(id) && Round>=3) {
- menu_display(id, gMenu, 0)
- }
- else if(is_user_alive(id) && is_vip_hour(22, 10) && Round>=3){
- menu_display(id, gMenu, 0)
- }
- return PLUGIN_HANDLED;
- }
- public Event_Death()
- {
- new iVictimID = read_data(2)
- new headshot = read_data(3)
- new iWeapon, iAttackerID = get_user_attacker( iVictimID, iWeapon )
- if( !is_user_connected(iVictimID) )
- return PLUGIN_CONTINUE
- if( !is_user_connected(iAttackerID) || iVictimID == iAttackerID )
- return PLUGIN_CONTINUE
- if(is_user_vip(iAttackerID))
- {
- if(headshot && get_user_health(iAttackerID) < 85)
- {
- set_user_health( iAttackerID, get_user_health( iAttackerID ) + 15 )
- }
- if(!headshot && get_user_health(iAttackerID) < 90)
- {
- set_user_health( iAttackerID, get_user_health( iAttackerID ) + 10 )
- }
- }
- return PLUGIN_CONTINUE
- }
- public setVip()
- {
- new players[32], pNum
- get_players(players, pNum, "a")
- for (new i = 0; i < pNum; i++)
- {
- new id = players[i]
- if ( is_user_vip(id) )
- {
- message_begin(MSG_ALL, get_user_msgid("ScoreAttrib"))
- write_byte(id)
- write_byte(4)
- message_end()
- }
- }
- return PLUGIN_HANDLED
- }
- //STOCK GIVE WEAPON
- cs_give_user_weapon(id, szWeapon[], iWeapon, iBpAmmo)
- {
- give_item(id, szWeapon)
- cs_set_user_bpammo(id, iWeapon, iBpAmmo)
- }
- //STOCK GET TIME
- bool:is_vip_hour(iStart, iEnd)
- {
- new iHour; time(iHour)
- return bool:(iStart < iEnd ? (iStart <= iHour < iEnd) : (iStart <= iHour || iHour < iEnd))
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement