Code:
// *** Admin/Silver/Golden Flags ***
#define ADMIN ADMIN_MAP
#define GOLDEN ADMIN_LEVEL_H
#define SILVER ADMIN_LEVEL_G
// Final Flag
#define FLAGS (ADMIN|GOLDEN|SILVER)
public plugin_init()
{
register_concmd("amx_solo", "admin_solo", FLAGS)
}
public admin_solo(id, level, cid)
{
if(!cmd_access(id, level, cid, 1))
return PLUGIN_HANDLED
if(solorun == true)
{
console_print(id, "The mode is already activated")
return PLUGIN_HANDLED
}
else
{
new players[32], count, player
get_players(players, count, "a")
soloid = players[random(count)]
while(soloid == g_lastid)
{
soloid = players[random(count)]
}
for(new i; i<count; i++)
{
player = players[i]
strip_user_weapons(player)
if(player == soloid)
{
give_item(player, "weapon_usp")
give_item(player, "weapon_knife")
engclient_cmd(player, "weapon_usp")
}
else
{
give_item(player, "weapon_knife")
engclient_cmd(player, "weapon_knife")
}
}
cs_set_user_bpammo(soloid, CSW_USP, get_pcvar_num(g_soloammo))
cs_set_user_model(soloid, "vip")
new name[32], name2[32]
get_user_name(soloid, name, 31) // Solo Name
get_user_name(id, name2, 31) // Admin/Silver/Golden name
console_print(id, "You have started SoloGunner Mode")
if(get_user_flags(id) & SILVER)
client_print(0, print_chat, "Silver player: %s Has activated the SoloGunner mode! The Sologunner is: %s", name2, name)
else if(get_user_flags(id) & ADMIN)
client_print(0, print_chat, "ADMIN: %s Has activated the SoloGunner mode! The Sologunner is: %s", name2, name)
else if(get_user_flags(id) & GOLDEN)
client_print(0, print_chat, "Golden player: %s Has activated the SoloGunner mode! The Sologunner is: %s", name2, name)
client_print(soloid, print_chat, "[SOLO-MOD] You are the SoloGunner!")
client_print(soloid, print_chat, "[SOLO-MOD] On each kill you make you will be rewarded with %d.", get_pcvar_num(g_Bkill))
BlockBuyZones()
issolo[soloid] = true
g_lastid = soloid
solorun = true
gsolo_Killed_bdis = false
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}