hi guys i edited codes plugin
Blizzard link
HERE
i removed some codes now the plugin give vip round just to CT team.
well now let me take example:
now i will start the round
amx_vip ok ??
the plugin will give vip to random player from CT team
example: it will give the vip to player his name "acer"
now when the round started! any one will kill the vip "acer"
the round will ended!
ok??
well the round ended in next round anyone kill "acer" the round
also will ended!! i need the plugin work in one round
in mean in new rounds when killed "acer" nothing will happen
i hope you understand what i need
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <engine>
#include <fakemeta>
#include <hamsandwich>
#include <xs>
#include <colorchat>
#include <csx>
#include <fun>
#pragma semicolon 1
#define PLUGIN "Protect The VIP"
#define VERSION "1.0.2"
#define AUTHOR "Blizzard"
#define CHAT_PREFIX "^4[CS]^1"
// Variables
new g_results;
new const CTVIP[ ] = { "models/player/vip/vip.mdl" };
new const VIPRadio[] = { "radio/vip.wav" };
new ct_vip_userid;
new bool:g_bIsVIP[ 33 ];
new bool:g_bInTeamSpec[ 33 ];
new CsTeams:Team;
public plugin_precache( )
{
precache_model( CTVIP );
precache_sound( VIPRadio );
}
public plugin_init( ) {
register_plugin( PLUGIN, VERSION, AUTHOR );
server_print( "^n^t%s v%s, Copyright (C) 2013 by %s^n", PLUGIN, VERSION, AUTHOR );
register_cvar( "protectvip_version", VERSION, FCVAR_SERVER|FCVAR_SPONLY );
register_concmd("amx_vip", "xrun");
register_event( "DeathMsg", "Event_DeathMsg", "a" );
register_message( get_user_msgid( "TextMsg" ), "msgTextMsg" );
g_results = CreateHudSyncObj();
}
public xrun()
{
arrayset( g_bIsVIP, false, sizeof( g_bIsVIP ) );
Set_CT_VIP( );
}
public Event_DeathMsg()
{
new iVictim = read_data( 2 );
new CT_VIP = find_player( "k", ct_vip_userid );
if( iVictim == CT_VIP )
{
ForceTeamLose( CS_TEAM_CT );
cs_reset_user_model( CT_VIP );
fm_set_rendering(CT_VIP);
}
}
public msgTextMsg( )
{
static textmsg[ 22 ];
get_msg_arg_string( 2, textmsg, 21 );
new CT_VIP = find_player( "k", ct_vip_userid );
// Terrorist Win
if( equal( textmsg, "#Terrorists_Win" ) )
{
if( !is_user_alive( CT_VIP ) )
{
set_hudmessage(255, 20, 20, -1.0, 0.17, 0, 0.0, 3.0, 2.0, 1.0, -1);
ShowSyncHudMsg(0, g_results,"Terrorists have taken over the world!") ;
}
else
{
set_hudmessage(255, 20, 20, -1.0, 0.17, 0, 0.0, 3.0, 2.0, 1.0, -1);
ShowSyncHudMsg(0, g_results,"Terrorists have taken over the world!") ;
}
return PLUGIN_HANDLED;
}
return PLUGIN_CONTINUE;
}
public ForceTeamLose( CsTeams:PTeam )
{
new iPlayers[ 32 ], iNum, i, Players;
get_players( iPlayers, iNum, "ae", PTeam == CS_TEAM_CT ? "CT" : "TERRORIST" );
Team = PTeam;
for( i = 0; i < iNum; i++ )
{
Players = iPlayers[ i ];
g_bInTeamSpec[ Players ] = true;
cs_set_user_team( Players, CS_TEAM_SPECTATOR );
set_task( 0.1, "FixPlayersTeam", Players );
}
}
public FixPlayersTeam(id)
{
if(g_bInTeamSpec[id])
{
cs_set_user_team(id, Team);
}
}
stock Set_CT_VIP()
{
new iPlayers[32], iNum, CT_VIP;
get_players(iPlayers, iNum, "ae", "CT");
if(!iNum) return;
CT_VIP = iPlayers[random(iNum)];
ct_vip_userid = get_user_userid( CT_VIP);
g_bIsVIP[CT_VIP] = true;
for(new i = 0; i < iNum; i++)
{
if(iPlayers[i] != CT_VIP)
{
ColorChat(iPlayers[i], GREY, "%s ^3%s^1 is now a^4 Captain", CHAT_PREFIX, user_name(CT_VIP));
}
else if(CT_VIP)
{
ColorChat(CT_VIP, GREY, "%s You are the^4 Captain^1 be careful to yourself...", CHAT_PREFIX);
set_user_health( CT_VIP, 150 );
cs_set_user_armor(CT_VIP, 100, CS_ARMOR_VESTHELM);
cs_set_user_model(CT_VIP, "vip");
fm_set_rendering(CT_VIP, kRenderFxGlowShell, 255, 0, 186, kRenderNormal, 10);
}
client_cmd(iPlayers[ i ], "spk %s", VIPRadio);
}
}
stock user_name(id)
{
new szName[32];
get_user_name(id, szName, charsmax(szName));
return szName;
}
// Set entity's rendering type (from fakemeta_util)
stock fm_set_rendering(entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16)
{
static Float:color[3];
color[0] = float(r);
color[1] = float(g);
color[2] = float(b);
set_pev(entity, pev_renderfx, fx);
set_pev(entity, pev_rendercolor, color);
set_pev(entity, pev_rendermode, render);
set_pev(entity, pev_renderamt, float(amount));
}
__________________