Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*This Plugin Is Originally Created By Dunno But Edited By DON KHAN
- *Added VIP Prefix, Gravity, New Style VIP MENU Etc...
- *Change Log:
- * 3.0: Dunno's Released.
- * After 3.0 DON KHAN's Released.
- * 3.1: Added Gravity.
- * 3.2: Added chat(player, "!g[VIP] You Got He Grenade, Armor, Thighpack.")
- * 3.3: Fixed All Bugs.
- * 3.4: Added New Style VIP Menu.
- * 3.5: Added VIP Tag.
- * 3.6: Fixed All Bugs & Error.
- * 3.7: Added VIP On Scoreboard
- * 3.8: Optimized Code
- * 3.9: Added Glow For VIPs
- * 4.0: Added A Specific Glow Of VIP's Team: Blue For CT & Red For T + Optimized Code.
- */
- #define DAMAGE_RECIEVED
- #include <amxmodx>
- #include <amxmisc>
- #include <cstrike>
- #include <fun>
- #include <hamsandwich>
- static const COLOR[] = "!g" //green
- static const CONTACT[] = "www.steam.lv/forum"
- new maxplayers
- new mpd, mkb, mhb
- new g_MsgSync
- new money_add
- new money_hs_add
- new money_max
- new nKiller
- new nKiller_money
- new nMoney_add
- new nMoney_max
- new VIPPrefix
- new g_awp_active
- new g_menu_active
- new CurrentRound
- new bool:HasC4[33]
- new vips[33]
- new SzMaxPlayers, SzSayText;
- new SzGTeam[3][] = {
- "Spectator",
- "Terrorist",
- "Counter-Terrorist"
- }
- #define Keysrod (1<<0)|(1<<1)|(1<<9) // Keys: 1234567890
- #if defined DAMAGE_RECIEVED
- new g_MsgSync2
- #endif
- // VIP Glow Access
- new const VIP_ACCESS = ADMIN_LEVEL_H
- // VIP Prefix
- #define FLAGADMINVIP ADMIN_LEVEL_H
- #define PREFIXADMINVIP ".::V.I.P::."
- // VIP Scoreboard Access
- #define VIP_LEVEL ADMIN_LEVEL_H
- public plugin_init()
- {
- register_plugin("VIP Eng Version", "4.0", "Dunno & DON KHAN")
- mpd = register_cvar("money_per_damage","3")
- mkb = register_cvar("money_kill_bonus","20")
- mhb = register_cvar("money_hs_bonus","50")
- money_add = register_cvar("amx_vip_hp", "250")
- money_hs_add = register_cvar("amx_vip_money_hs", "500")
- money_max = register_cvar("amx_vip_max_money", "20000")
- VIPPrefix = register_cvar("show_VIP_admin_prefix", "1")
- g_awp_active = register_cvar("awp_active", "0")
- g_menu_active = register_cvar("menu_active", "1")
- register_event("Damage","Damage","b")
- register_event("DeathMsg","death_msg","a")
- register_event("ResetHUD","resethud","be") // For VIP Show In Scoreboard
- register_clcmd("awp","HandleCmd")
- register_clcmd("say /vipinfo","ShowMotd")
- maxplayers = get_maxplayers()
- register_clcmd("say", "handle_say")
- register_cvar("amx_contactinfo", CONTACT, FCVAR_SERVER)
- register_logevent("LogEvent_RoundStart", 2, "1=Round_Start" );
- register_event("TextMsg","Event_RoundRestart","a","2&#Game_w")
- register_event("TextMsg","Event_RoundRestart","a","2&#Game_C");
- register_event("DeathMsg", "hook_death", "a", "1>0")
- register_event("Damage", "on_damage", "b", "2!0", "3=0", "4!0")
- RegisterHam(Ham_Spawn, "player", "PlayerPostSpawn", 1); // For Glow Of VIP's Team.
- register_clcmd("say", "hook_say")
- register_clcmd("say_team", "hook_say_team")
- SzSayText = get_user_msgid ("SayText")
- SzMaxPlayers = get_maxplayers()
- register_message(SzSayText, "MsgDuplicate")
- g_MsgSync = CreateHudSyncObj()
- #if defined DAMAGE_RECIEVED
- g_MsgSync2 = CreateHudSyncObj()
- #endif
- }
- public MsgDuplicate(id){ return PLUGIN_HANDLED; }
- public PlayerPostSpawn(id)
- {
- if(is_user_alive (id) && get_user_flags(id) & VIP_ACCESS)
- set_user_rendering(id, kRenderFxGlowShell, cs_get_user_team(id) == CS_TEAM_CT ? 0 : 255, 0, cs_get_user_team(id) == CS_TEAM_CT ? 255 : 0, kRenderNormal, 16)
- }
- public on_damage(id)
- {
- new attacker = get_user_attacker(id)
- #if defined DAMAGE_RECIEVED
- // id should be connected if this message is sent, but lets check anyway
- if ( is_user_connected(id) && is_user_connected(attacker) )
- if (get_user_flags(attacker) & ADMIN_LEVEL_H)
- {
- new damage = read_data(2)
- set_hudmessage(255, 0, 0, 0.45, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1)
- ShowSyncHudMsg(id, g_MsgSync2, "%i^n", damage)
- #else
- if ( is_user_connected(attacker) && if (get_user_flags(attacker) & ADMIN_LEVEL_H) )
- {
- new damage = read_data(2)
- #endif
- set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1)
- ShowSyncHudMsg(attacker, g_MsgSync, "%i^n", damage)
- }
- }
- public Damage(id)
- {
- new weapon, hitpoint, attacker = get_user_attacker(id,weapon,hitpoint)
- if(attacker<=maxplayers && is_user_alive(attacker) && attacker!=id)
- if (get_user_flags(attacker) & ADMIN_LEVEL_H)
- {
- new money = read_data(2) * get_pcvar_num(mpd)
- if(hitpoint==1) money += get_pcvar_num(mhb)
- cs_set_user_money(attacker,cs_get_user_money(attacker) + money)
- }
- }
- public death_msg()
- {
- if(read_data(1)<=maxplayers && read_data(1) && read_data(1)!=read_data(2)) cs_set_user_money(read_data(1),cs_get_user_money(read_data(1)) + get_pcvar_num(mkb) - 300)
- }
- public LogEvent_RoundStart()
- {
- CurrentRound++;
- new players[32], player, pnum;
- get_players(players, pnum, "a");
- for(new i = 0; i < pnum; i++)
- {
- player = players[i];
- if(is_user_alive(player) && get_user_flags(player) & ADMIN_LEVEL_H)
- {
- give_item(player, "weapon_hegrenade")
- give_item(player, "item_assaultsuit")
- give_item(player, "item_thighpack")
- set_user_gravity(player, 720.0 / 800)
- give_item(player,"weapon_deagle")
- give_item(player,"ammo_50ae")
- give_item(player,"ammo_50ae")
- give_item(player,"ammo_50ae")
- give_item(player,"ammo_50ae")
- give_item(player,"ammo_50ae")
- give_item(player,"ammo_50ae")
- give_item(player,"ammo_50ae")
- chat(player, "!g[VIP] You Got Deagle, He Grenade, Low Gravity, Armor, Thighpack.")
- if (!get_pcvar_num(g_menu_active))
- return PLUGIN_CONTINUE
- if(CurrentRound >= 3)
- {
- Showrod(player);
- }
- }
- }
- return PLUGIN_HANDLED
- }
- public Event_RoundRestart()
- {
- CurrentRound=0;
- }
- public hook_death()
- {
- // Killer id
- nKiller = read_data(1)
- if ( (read_data(3) == 1) && (read_data(5) == 0) )
- {
- nMoney_add = get_pcvar_num (money_hs_add)
- }
- else
- nMoney_add = get_pcvar_num (money_add)
- nMoney_max = get_pcvar_num (money_max)
- // Updating Killer Money
- if(!(get_user_flags(nKiller) & ADMIN_LEVEL_H))
- return;
- nKiller_money += nMoney_add
- // Maximum Money check
- if (nKiller_money > nMoney_max) nKiller_money = nMoney_max
- // Hud message "Added +%d Money"
- set_hudmessage(0, 255, 0, -1.0, 0.15, 0, 1.0, 1.0, 0.1, 0.1, -1)
- show_hudmessage(nKiller, "Added +%d Money", nMoney_add)
- // Screen fading
- message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, nKiller)
- write_short(1<<10)
- write_short(1<<10)
- write_short(0x0000)
- write_byte(0)
- write_byte(0)
- write_byte(200)
- write_byte(75)
- message_end()
- }
- public Showrod(id)
- {
- if(!is_user_connected(id) || !is_user_alive(id))
- return PLUGIN_HANDLED
- new menu = menu_create("\r[\y FREE VIP Guns \r]", "Pressedrod")
- menu_additem(menu, "\wAK47 + Desert Eagle", "0", 0)
- menu_additem(menu, "\wM4A1 + Desert Eagle^n", "1", 0)
- menu_additem(menu, "\wAWP + USP", "2", 0)
- menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
- menu_display(id, menu, 0)
- return PLUGIN_HANDLED
- }
- public Pressedrod(id, menu, item)
- {
- new data[6], name[64]
- new access, callback
- menu_item_getinfo(menu, item, access, data, 5, name, 63, callback)
- switch(str_to_num(data))
- {
- case 0:
- {
- if (user_has_weapon(id, CSW_C4) && get_user_team(id) == 1)
- HasC4[id] = true;
- else
- HasC4[id] = false;
- strip_user_weapons (id)
- give_item(id,"weapon_ak47")
- give_item(id,"ammo_762nato")
- give_item(id,"ammo_762nato")
- give_item(id,"ammo_762nato")
- give_item(id,"weapon_deagle")
- give_item(id,"ammo_50ae")
- give_item(id,"ammo_50ae")
- give_item(id,"ammo_50ae")
- give_item(id,"ammo_50ae")
- give_item(id,"ammo_50ae")
- give_item(id,"ammo_50ae")
- give_item(id,"ammo_50ae")
- give_item(id,"weapon_knife")
- give_item(id,"weapon_hegrenade")
- give_item(id, "weapon_smokegrenade");
- give_item(id, "item_assaultsuit");
- give_item(id, "item_thighpack");
- chat(id, "!g[VIP]!n You Taked Free AK47 and Deagle")
- if (HasC4[id])
- {
- give_item(id, "weapon_c4");
- cs_set_user_plant( id );
- }
- }
- case 1:
- {
- if (user_has_weapon(id, CSW_C4) && get_user_team(id) == 1)
- HasC4[id] = true;
- else
- HasC4[id] = false;
- strip_user_weapons (id)
- give_item(id,"weapon_m4a1")
- give_item(id,"ammo_556nato")
- give_item(id,"ammo_556nato")
- give_item(id,"ammo_556nato")
- give_item(id,"weapon_deagle")
- give_item(id,"ammo_50ae")
- give_item(id,"ammo_50ae")
- give_item(id,"ammo_50ae")
- give_item(id,"ammo_50ae")
- give_item(id,"ammo_50ae")
- give_item(id,"ammo_50ae")
- give_item(id,"ammo_50ae")
- give_item(id,"weapon_knife")
- give_item(id,"weapon_hegrenade")
- give_item(id, "weapon_smokegrenade");
- give_item(id, "item_assaultsuit");
- give_item(id, "item_thighpack");
- chat(id, "!g[VIP]!n You Taked Free M4A1 and Deagle")
- if (HasC4[id])
- {
- give_item(id, "weapon_c4");
- cs_set_user_plant( id );
- }
- }
- case 2:
- {
- if (user_has_weapon(id, CSW_C4) && get_user_team(id) == 1)
- HasC4[id] = true;
- else
- HasC4[id] = false;
- strip_user_weapons (id)
- give_item(id,"weapon_awp")
- give_item(id,"ammo_338magnum")
- give_item(id,"ammo_338magnum")
- give_item(id,"ammo_338magnum")
- give_item(id,"weapon_usp")
- give_item(id,"ammo_45acp")
- give_item(id,"ammo_45acp")
- give_item(id,"ammo_45acp")
- give_item(id,"ammo_45acp")
- give_item(id,"ammo_45acp")
- give_item(id,"ammo_45acp")
- give_item(id,"ammo_45acp")
- give_item(id,"ammo_45acp")
- give_item(id,"ammo_45acp")
- give_item(id,"weapon_knife")
- give_item(id,"weapon_hegrenade")
- give_item(id, "weapon_smokegrenade");
- give_item(id, "item_assaultsuit");
- give_item(id, "item_thighpack");
- chat(id, "!g[VIP]!n You Taked Free AWP and USP")
- if (HasC4[id])
- {
- give_item(id, "weapon_c4");
- cs_set_user_plant( id );
- }
- }
- }
- }
- public HandleCmd(id){
- if (!get_pcvar_num(g_awp_active))
- return PLUGIN_CONTINUE
- if(get_user_flags(id) & ADMIN_LEVEL_H)
- return PLUGIN_CONTINUE
- chat(id, "!g[VIP]!n Sniper's Only For VIP's")
- return PLUGIN_HANDLED
- }
- public ShowMotd(id)
- {
- show_motd(id, "vip.txt")
- }
- public client_authorized(id)
- {
- set_task(40.0, "PrintText" ,id)
- }
- public PrintText(id)
- {
- chat(id, "!g[VIP]!n Write!g /vipinfo!n To See VIP Privileges!")
- }
- public handle_say(id) {
- new said[192]
- read_args(said,192)
- if( ( containi(said, "who") != -1 && containi(said, "admin") != -1 ) || contain(said, "/vips") != -1 )
- set_task(0.1,"print_adminlist",id)
- return PLUGIN_CONTINUE
- }
- public print_adminlist(user)
- {
- new adminnames[33][32]
- new message[256]
- new contactinfo[256], contact[112]
- new id, count, x, len
- for(id = 1 ; id <= maxplayers ; id++)
- if(is_user_connected(id))
- if(get_user_flags(id) & ADMIN_LEVEL_H)
- get_user_name(id, adminnames[count++], 31)
- len = format(message, 255, "%s VIP ONLINE: ",COLOR)
- if(count > 0) {
- for(x = 0 ; x < count ; x++) {
- len += format(message[len], 255-len, "%s%s ", adminnames[x], x < (count-1) ? ", ":"")
- if(len > 96 ) {
- chat(user, message)
- len = format(message, 255, "%s ",COLOR)
- }
- }
- chat(user, message)
- }
- else {
- len += format(message[len], 255-len, "No VIP online.")
- chat(user, message)
- }
- get_cvar_string("amx_contactinfo", contact, 63)
- if(contact[0]) {
- format(contactinfo, 111, "%s Contact Server Admin -- %s", COLOR, contact)
- chat(user, contactinfo)
- }
- }
- public hook_say(id)
- {
- new SzMessages[192], SzName[32];
- new SzAlive = is_user_alive(id);
- new SzGetFlag = get_user_flags(id);
- read_args(SzMessages, 191);
- remove_quotes(SzMessages);
- get_user_name(id, SzName, 31);
- if(!is_valid_msg(SzMessages))
- return PLUGIN_CONTINUE;
- if(get_pcvar_num(VIPPrefix) && SzGetFlag & FLAGADMINVIP)(SzAlive ? format(SzMessages, 191, "^4[%s] ^3%s : ^4%s", PREFIXADMINVIP, SzName, SzMessages) : format(SzMessages, 191, "^1*DEAD* ^4[%s] ^3%s : ^4%s", PREFIXADMINVIP, SzName, SzMessages));
- else if(get_pcvar_num(VIPPrefix) && !(SzGetFlag & FLAGADMINVIP))(SzAlive ? format(SzMessages, 191, "^3%s : ^1%s", SzName, SzMessages) : format(SzMessages, 191, "^1*DEAD* ^3%s : ^1%s", SzName, SzMessages));
- for(new i = 1; i <= SzMaxPlayers; i++)
- {
- if(!is_user_connected(i))
- continue;
- if(SzAlive && is_user_alive(i) || !SzAlive && !is_user_alive(i))
- {
- message_begin(MSG_ONE, get_user_msgid("SayText"), {0, 0, 0}, i);
- write_byte(id);
- write_string(SzMessages);
- message_end();
- }
- }
- return PLUGIN_CONTINUE;
- }
- public hook_say_team(id){
- new SzMessages[192], SzName[32];
- new SzAlive = is_user_alive(id);
- new SzGetFlag = get_user_flags(id);
- new SzGetTeam = get_user_team(id);
- read_args(SzMessages, 191);
- remove_quotes(SzMessages);
- get_user_name(id, SzName, 31);
- if(!is_valid_msg(SzMessages))
- return PLUGIN_CONTINUE;
- if(get_pcvar_num(VIPPrefix) && SzGetFlag & FLAGADMINVIP)(SzAlive ? format(SzMessages, 191, "^1(%s) ^4[%s] ^3%s : ^4%s", SzGTeam[SzGetTeam], PREFIXADMINVIP, SzName, SzMessages) : format(SzMessages, 191, "^1*DEAD* ^1(%s) ^4[%s] ^3%s : ^4%s", SzGTeam[SzGetTeam], VIPPrefix, SzName, SzMessages));
- else if(get_pcvar_num(VIPPrefix) && !(SzGetFlag & FLAGADMINVIP))(SzAlive ? format(SzMessages, 191, "^1(%s) ^3%s : ^1%s", SzGTeam[SzGetTeam], SzName, SzMessages) : format(SzMessages, 191, "^1*DEAD* ^1(%s) ^3%s : ^1%s", SzGTeam[SzGetTeam], SzName, SzMessages));
- for(new i = 1; i <= SzMaxPlayers; i++)
- {
- if(!is_user_connected(i))
- continue;
- if(get_user_team(i) != SzGetTeam)
- continue;
- if(SzAlive && is_user_alive(i) || !SzAlive && !is_user_alive(i))
- {
- message_begin(MSG_ONE, get_user_msgid("SayText"), {0, 0, 0}, i);
- write_byte(id);
- write_string(SzMessages);
- message_end();
- }
- }
- return PLUGIN_CONTINUE;
- }
- bool:is_valid_msg(const SzMessages[]){
- if( SzMessages[0] == '@'
- || !strlen(SzMessages)){ return false; }
- return true;
- }
- public client_putinserver(id)
- {
- if(access(id,VIP_LEVEL))
- {
- vips[id] = true
- }
- }
- public client_disconnect(id)
- {
- if( vips[id] )
- {
- vips[id] = false
- }
- }
- public resethud(id)
- {
- if( vips[id] )
- {
- set_user_scoreattrib(id,4)
- }
- }
- stock set_user_scoreattrib(id,attrib=0)
- {
- message_begin(2,get_user_msgid("ScoreAttrib"),{0,0,0},0);
- write_byte(id);
- write_byte(attrib);
- message_end();
- }
- stock chat(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, "!n", "^1");
- replace_all(msg, 190, "!t", "^3");
- if(id) players[0] = id;
- else get_players(players, count, "ch"); {
- for(new i = 0; i < count; i++) {
- if(is_user_connected(players[i])) {
- message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
- write_byte(players[i]);
- write_string(msg);
- message_end();
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment