hi guys i moded this plugin
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <csx>
#include <hamsandwich>
#include <cstrike>
#include <engine>
#include <fun>
#include <fakemeta>
#include <colorchat>
new const g_szModel[32] = "vip"
new g_iChosen
// Create the HUD Sync Objects
new g_MsgSync
// HUD messages
const Float:HUD_EVENT_X = -1.0
const Float:HUD_EVENT_Y = 0.17
public plugin_init()
{
register_plugin("1 vs all", "1.0", "Flicker")
register_clcmd( "cs_vsall", "onNewRound", ADMIN_BAN, "vsALL Round!!!" )
register_event("DeathMsg", "onDeathMsgEvent", "a")
RegisterHam(Ham_Spawn, "player", "onPlayerSpawn", 1)
// Create the HUD Sync Objects
g_MsgSync = CreateHudSyncObj()
}
public plugin_precache()
{
new szModel[64]
formatex(szModel, charsmax(szModel), "models/player/vip/vip.mdl")
precache_model(szModel)
}
public onNewRound(id,level,cid){
if(!cmd_access(id,level,cid,3))return PLUGIN_HANDLED;
set_task(0.1, "ChooseTheOne")
}
public onPlayerSpawn(id)
{
if(is_user_alive(id) && g_iChosen == id)
{
new szModel[32]
cs_get_user_model(id, szModel, charsmax(szModel))
if(!equali(szModel, g_szModel))
cs_set_user_model(id, g_szModel)
}
}
public ChooseTheOne()
{
if(!g_iChosen)
g_iChosen = GetRandomPlayer("ah")
new players[32], num, id
get_players(players, num, "ah")
for(new i; i < num; i++)
{
id = players[i]
strip_user_weapons(id)
give_item(id, "weapon_knife")
set_user_health(id, 200)
cs_set_user_armor(id, 50, CS_ARMOR_VESTHELM);
cs_set_user_team(id, id == g_iChosen ? CS_TEAM_T : CS_TEAM_CT)
ExecuteHamB(Ham_CS_RoundRespawn, id)
}
set_user_health(g_iChosen, 250)
cs_set_user_armor(g_iChosen, 200, CS_ARMOR_VESTHELM);
strip_user_weapons(g_iChosen)
give_item(g_iChosen,"weapon_awp")
give_item(g_iChosen,"weapon_knife")
give_item(g_iChosen,"weapon_deagle")
cs_set_user_bpammo(g_iChosen,CSW_AWP,3)
cs_set_user_bpammo(g_iChosen,CSW_DEAGLE,7)
new szName[32]
get_user_name(g_iChosen, szName, charsmax(szName))
ColorChat(0, GREY, "^4[CS]^3 %s^1 bought^4 Sniper", szName)
set_hudmessage(20, 255, 255, HUD_EVENT_X, HUD_EVENT_Y, 1, 0.0, 5.0, 1.0, 1.0, -1)
ShowSyncHudMsg(0, g_MsgSync, "%s is Sniper !!!", szName)
client_cmd(0, "spk ^"ambience/port_suckin1^"")
}
public onDeathMsgEvent()
{
new kil = read_data(1)
new vic = read_data(2)
if(!is_user_connected(kil) || !is_user_connected(vic))
return
if(g_iChosen == vic)
{
cs_reset_user_model(vic)
new szName[32]
get_user_name(kil, szName, charsmax(szName))
if(g_iChosen == kil)
{
g_iChosen = GetRandomPlayer("h")
cs_set_user_model(g_iChosen, g_szModel)
return
}
g_iChosen = kil
}
}
public client_disconnect(id)
{
if(id == g_iChosen)
{
new szName[32]
get_user_name(id, szName, charsmax(szName))
g_iChosen = GetRandomPlayer("h")
while(get_user_team(g_iChosen) == 3)
g_iChosen = GetRandomPlayer("h")
new szNewName[32]
get_user_name(g_iChosen, szNewName, charsmax(szNewName))
ColorChat(0, GREY, "^4[CS]^1 Last sniper,^3 %s^1 disconnected,^4 %s^1 is the last sniper!", szName, szNewName)
}
}
stock GetRandomPlayer(const flags[])
{
new players[32], num
get_players(players, num, flags)
return num ? players[random(num)] : 0
}
this plugin make challenge
one VS all ok ?
it's give
random challenge to players i want development it
so that the player can buy this mod with frags if the player have
50 frags
he can buy this mod
for himself
example:
now i'm player my name
arvEL and i have
50 frags
i want buy this mod to myself i open console and write cs_vsall
the server will give this mod to me
i will became sniper and all player have knifes
i wish you understand what i mean and what i need
sorry my english bad