this plugin is compiling 100% with 0 error but /shop is not working for T and also please dont remove cmd_shop ...first users have to go through cmd_shop and then shopmenu
PHP Code:
/*
Cookie Force Jailbreak Plugin
Description:
Cvars:
- jb_points_kill How many points a T gets for killing a ct
- jb_shop_gunprice How many points a gun gamble costs
- jb_s hop_pillsprice How many points Pills cost
- jb_shop_armorprice How many points armor costs
- jb_shop_camoprice How many points camo costs
- jb_show_players SHows a hud with players left on top of screen
- jb_days Shows the days HUD
- jb_shop Opens the shop
- jb_points_headshot How many points T's get for killing a ct with a headshot
- jb_shop_nadepack_price How many points the nade pack costs
- jb_showrebels Show rebels when they kill someone or not
- jb_blocktv oice Blocks Terrorist from voice chat
- jb_enable_days Enables the days menu
- jb_teleport Enables/ disables the teleports on LR
Notes:
I never though i would ever make this public, but since i stopped my jailbreak, due to few players, i'm releasing it.
The shops points are cookies, because the clan i made this for it called Cookie Force, so it was funny to make it cookies.
To disable ColorChat, comment define USE_CC on line 83
*/
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#include <hamsandwich>
#include <fakemeta>
#include <engine>
#include <nvault>
#define USE_CC
#if defined USE_CC
#include <colorchat>
#endif
///////////////
// =Defines= //
///////////////
#define VERSION "3.2"
#define set_bit(%1,%2) %1 |= ( 1 << ( %2 & 31 ) )
#define IsPlayer(%1) (1<=%1<=g_max_clients)
#define REQUIRED_ADMIN_LEVEL ADMIN_KICK
#define ADMIN_VOICE ADMIN_MENU
#define OFFSET_PRIMARYWEAPON 116
/////////////////////////////////////////////////////////
//////////////////
// =New things= //
//////////////////
#if defined USE_CC
new const PREFIX[] = "[AMXX]^x04:" // Prefix
#else
new const PREFIX[] = "[AMXX]:" // Normal prefix
#endif
new g_max_clients //client check
// Cvars
new cvar_killpoints // How many Cookies a terrorist gets for 1 ct kill
new cvar_gunprice // How many Cookies a gun costs
new cvar_pillsprice // How many Cookies pills costs
new cvar_camoprice // How many Cookies camo costs
new cvar_invprice
new cvar_gunpackprice
new cvar_grenadeprice
new cvar_flashprice
new cvar_crowprice
new cvar_nadepackprice // How many Cookies nades cost
new cvar_headshotpoints // How many extra points a t gets for killing a ct
// Is days hud should be displayed or not
new cvar_showplayers // Shows the players in a nice hud message
new cvar_shop // Open or close the shop
new cvar_showrebels // Show rebels in chat
new cvar_tvoiceblock // Block T's from using voicechat
new g_bHasInvis
// Points system
new playerpoints[33] // Amount of Cookies a player has
new g_vault // Open a new vault to store a players points.
// Other Stuff
new g_guards
new g_prisoners
////////////////
// =Booleans= //
////////////////
new bool: got_camo[33] // Does player got camo?
new bool: is_rebel[33] // Is the player a rebel?
new bool: can_have_gun[33] // Can he have a gun?
new bool:g_connected[33]
///////////////////////////////////////////////////////////////
//////////////
// =Stocks= //
//////////////
stock check_user(index)
{
if(!is_user_connected(index) ||(is_user_bot(index)))
{
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}
stock strip_weapons(index)
{
strip_user_weapons(index)
set_pdata_int(index, OFFSET_PRIMARYWEAPON, 0)
give_item(index, "weapon_knife")
}
//////////////////////////////////////////////////////////////
//---------------PLUGIN INIT--------------------------------//
//////////////////////////////////////////////////////////////
public plugin_init()
{
register_plugin("CF Jailbreak", VERSION, "Drekes")
//cvars
cvar_killpoints = register_cvar("jb_points_kill", "3")
cvar_grenadeprice = register_cvar("jb_shop_grenadeprice", "5")
cvar_flashprice = register_cvar("jb_shop_flashprice", "15")
cvar_pillsprice = register_cvar("jb_shop_pillsprice", "15")
cvar_gunprice = register_cvar("jb_shop_gunprice", "25")
cvar_crowprice = register_cvar("jb_shop_crowprice", "30")
cvar_invprice = register_cvar("jb_shop_invprice", "45")
cvar_camoprice = register_cvar("jb_shop_camoprice", "50")
cvar_gunpackprice = register_cvar("jb_shop_gunpacksprice", "60")
cvar_showplayers = register_cvar("jb_show_players", "1")
cvar_shop = register_cvar("jb_shop", "1")
cvar_headshotpoints = register_cvar("jb_points_headshot", "2")
cvar_nadepackprice = register_cvar("jb_shop_nadepack_price", "10")
cvar_showrebels = register_cvar("jb_show_rebels", "1")
cvar_tvoiceblock = register_cvar("jb_blocktvoice", "1")
register_cvar("cfjail_version", VERSION, FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_UNLOGGED|FCVAR_SPONLY)
RegisterHam(Ham_Spawn, "player", "Event_Playerspawn", 1)
RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_deagle", "fw_primary_attack")
RegisterHam(Ham_TakeDamage, "player", "Event_TakeDamage")
register_forward(FM_Voice_SetClientListening, "FwdSetVoice");
//Events
register_event("DeathMsg", "Event_Deathmsg", "a")
register_logevent("Event_Roundend", 2, "1=Round_End")
register_logevent("Event_Roundstart", 2, "1=Round_Start")
register_event("CurWeapon", "Event_CurWeapon", "be","1=1")
//client commands
register_clcmd("say /rules", "showrules")
register_clcmd("say_team /rules", "showrules")
register_clcmd("say /shop", "cmd_shop")
register_clcmd("say_team /shop", "cmd_shop")
//Console (admin) Commands
register_concmd("amx_take_points", "cmd_take_points", ADMIN_KICK, "<target> <amount>")
register_concmd("amx_give_points", "cmd_give_points", ADMIN_KICK, "<target> <amount>")
//Other Things
g_max_clients = get_maxplayers()
g_vault = nvault_open("jbpoints") // Open a vault for the points
set_task(1.0, "players_hud", 0, _, _, "b")
}
///////////////////////////////////////////////////
//--------------PRECACHE-------------------------//
///////////////////////////////////////////////////
public plugin_precache()
{
precache_model("models/player/gign/gign.mdl")
}
///////////////////////////////////////////////////
//-------------PLAYER SPAWN----------------------//
///////////////////////////////////////////////////
public Event_Playerspawn(id)
{
if(cs_get_user_team(id) == CS_TEAM_T)
{
if(got_camo[id])
{
cs_reset_user_model(id)
got_camo[id] = false
}
if(is_rebel[id])
unrebel(id)
strip_weapons(id)
is_rebel[id] = false
}
can_have_gun[id] = true
set_user_rendering(id)
return PLUGIN_HANDLED
}
//////////////////////////////////////////////////////////////////
//--------------------PLAYER DEATH------------------------------//
//////////////////////////////////////////////////////////////////
public Event_Deathmsg()
{
new attacker = read_data(1)
new victim = read_data(2)
new headshot = read_data(3)
new AttackerName[32]
new VictimName[32]
get_user_name(attacker, AttackerName, 31)
get_user_name(victim, VictimName,31)
if(!IsPlayer(attacker))
return PLUGIN_HANDLED
if(!IsPlayer(victim))
return PLUGIN_HANDLED
if( cs_get_user_team(attacker) == CS_TEAM_CT && cs_get_user_team(victim) == CS_TEAM_T)
{
if(get_pcvar_num(cvar_showrebels))
{
if(!is_rebel[victim])
{
#if defined USE_CC
ColorChat(0, RED, "%s Guard^x03 %s^x04 killed prisoner^x03 %s!", PREFIX, AttackerName, VictimName)
#else
client_print(0, print_chat, "%s Guard %s killed prisoner %s!", PREFIX, AttackerName, VictimName)
#endif
}
else
{
#if defined USE_CC
ColorChat(0, RED, "%s Guard^x03 %s^x04 killed rebel^x03 %s!", PREFIX, AttackerName, VictimName)
#else
client_print(0, print_chat, "%s Guard %s killed rebel %s", PREFIX, AttackerName, VictimName)
#endif
unrebel(victim)
}
}
}
if( cs_get_user_team(attacker) == CS_TEAM_T && cs_get_user_team(victim) == CS_TEAM_CT)
{
playerpoints[attacker] += get_pcvar_num(cvar_killpoints)
if(headshot)
playerpoints[attacker] += get_pcvar_num(cvar_headshotpoints);
}
if(task_exists(attacker))
remove_task(attacker)
if(task_exists(victim))
remove_task(victim)
SaveData(attacker)
return PLUGIN_HANDLED
}
////////////////////////////////////////////////////////////
//-----------------ROUND END/ ROUND START-----------------//
////////////////////////////////////////////////////////////
public Event_Roundstart()
{
if(get_pcvar_num(cvar_showplayers))
{
g_guards = 0
g_prisoners = 0
}
}
/////////////////////////////////////////////////////
//-----------------TAKE DAMAGE---------------------//
/////////////////////////////////////////////////////
public Event_TakeDamage(victim, weapon, attacker, float: damage, damagebits)
{
if(IsPlayer(victim) && IsPlayer(attacker))
{
if(get_pcvar_num(cvar_showrebels) && !is_rebel[attacker] && IsPlayer(attacker) && IsPlayer(victim))
{
if(victim != attacker && attacker != 0)
{
if(cs_get_user_team(attacker) == CS_TEAM_T && cs_get_user_team(victim) == CS_TEAM_CT)
{
make_rebel(attacker, victim)
}
}
}
}
}
/////////////////////////////////////////////////////
//-----------------PLAYER DISCONNECTS--------------//
/////////////////////////////////////////////////////
public client_disconnect(id)
{
SaveData(id)
g_connected[id] = false;
}
//////////////////////////////////////////////////////
//----------------CLIENT PUTINSERVER----------------//
//////////////////////////////////////////////////////
public client_putinserver(id)
g_connected[id] = true;
//////////////////////////////////////////////////////
//-----------------SOMETHING ELSE-------------------//
//////////////////////////////////////////////////////
public Player_Jump(id)
{
if( is_user_alive(id) && entity_get_float(id, EV_FL_fuser2) > 0.0 )
{
entity_set_float(id, EV_FL_fuser2, 0.0)
}
}
//////////////////////////////////////////////////////
//-----------ON MAP CHANGE OR SERVER CRASH----------//
//////////////////////////////////////////////////////
public plugin_end()
{
nvault_close(g_vault)
}
public make_rebel(attacker, victim)
{
new attackername[33], victimname[33]
get_user_name(attacker, attackername, 32)
get_user_name(victim, victimname, 32)
#if defined USE_CC
ColorChat(0, RED, "%s^x03 %s^x04 attacked^x03 %s^x04 and is now a rebel", PREFIX, attackername, victimname)
#else
client_print(0, print_chat, "%s %s attacked %s and is now a rebel!", PREFIX, attackername, victimname)
#endif
set_user_rendering(attacker, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, 16)
is_rebel[attacker] = true
}
/////////////////////////////////////////////////////
//--------------UNDO REBEL-------------------------//
/////////////////////////////////////////////////////
public unrebel(id)
{
if(is_user_connected(id))
{
set_user_rendering(id, kRenderFxGlowShell, 255, 255, 255, kRenderNormal, 255)
is_rebel[id] = false
}
}
///////////////////////////////////////////////////////////////
//--------------------RULES MOTD-----------------------------//
///////////////////////////////////////////////////////////////
public showrules(id)
{
show_motd(id, "jailrules.txt", "Jailbreak Rules")
}
//////////////////////////////////////////////////////////////////
//----------------POINTS SAVE AND LOAD--------------------------//
//////////////////////////////////////////////////////////////////
public SaveData(id)
{
new authid[32];
get_user_authid(id,authid,31);
new vaultkey[64], vaultdata[64];
//Save their points
format(vaultkey,63,"jb-%s-points",authid);
format(vaultdata,63,"%d",playerpoints[id]);
set_vaultdata(vaultkey,vaultdata);
}
public LoadData(id)
{
new authid[32];
get_user_authid(id,authid,31);
new vaultkey[64], vaultdata[64];
//Load their points
format(vaultkey,63,"jb-%s-points",authid);
get_vaultdata(vaultkey,vaultdata,63);
playerpoints[id] = str_to_num(vaultdata);
}
//////////////////////////////////////////////////////////////
//----------------THE SHOP----------------------------------//
//////////////////////////////////////////////////////////////
public cmd_shop(id)
{
if(!get_pcvar_num(cvar_shop))
{
#if defined USE_CC
ColorChat(id, RED, "%s We are currently working on the shop, it will be opened soon.", PREFIX)
#else
client_print(id, print_chat, "%s We are currently working on the shop, it will be opened soon.", PREFIX)
#endif
return PLUGIN_HANDLED
}
if(cs_get_user_team(id) != CS_TEAM_T)
{
#if defined USE_CC
ColorChat(id, RED, "%s Only^x03 prisoners^x04 can use the shop", PREFIX)
#else
client_print(id, print_chat, "%s Only prisoners can use the shop!", PREFIX)
#endif
return PLUGIN_HANDLED;
}
if(is_rebel[id])
{
#if defined USE_CC
ColorChat(id, RED, "%s Rebelse can't use the shop", PREFIX)
#else
client_print(id, print_chat, "%s Rebels can't use the shop!", PREFIX)
#endif
return PLUGIN_HANDLED
}
if(!is_user_alive(id))
{
#if defined USE_CC
ColorChat(id, RED, "%s You must be^x03 alive^x04 to use the shop", PREFIX)
#else
client_print(id, print_chat, "%s You must be alive to use the shop!", PREFIX)
#endif
return PLUGIN_HANDLED
}
else if(cs_get_user_team(id) == CS_TEAM_T)
{
shopmenu(id)
}
return PLUGIN_CONTINUE
}
public shopmenu(id)
{
if(is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_T)
{
new szText[555 char]
new points = playerpoints[id]
formatex(szText, charsmax(szText), "[Jailbreak Shop]^n[Your Cookies: %d]", points)
new shopmenu = menu_create(szText, "sub_shopmenu")
formatex(szText, charsmax(szText), "Grenade [Cookies: %d]", get_pcvar_num(cvar_grenadeprice))
menu_additem(shopmenu, szText, "1", 0)
formatex(szText, charsmax(szText), "Flash Bang [Cookies: %d]", get_pcvar_num(cvar_flashprice))
menu_additem(shopmenu, szText, "2", 0)
formatex(szText, charsmax(szText), "Health Cookies [Cookies: %d]", get_pcvar_num(cvar_pillsprice))
menu_additem(shopmenu, szText, "3" , 0)
formatex(szText, charsmax(szText), "Nade pack [Cookies: %d]", get_pcvar_num(cvar_nadepackprice))
menu_additem(shopmenu, szText, "4", 0)
formatex(szText, charsmax(szText), "Gun Gamble [Cookies: %d]", get_pcvar_num(cvar_gunprice))
menu_additem(shopmenu, szText, "5", 0)
formatex(szText, charsmax(szText), "CrowBar[1 Hit Kill] [Cookies: %d]", get_pcvar_num(cvar_crowprice))
menu_additem(shopmenu, szText, "6", 0)
formatex(szText, charsmax(szText), "Invisibility 20 sec [Cookies: %d]", get_pcvar_num(cvar_invprice))
menu_additem(shopmenu, szText, "7", 0)
formatex(szText, charsmax(szText), "Camouflage [Cookies: %d]", get_pcvar_num(cvar_camoprice))
menu_additem(shopmenu, szText, "8", 0)
formatex(szText, charsmax(szText), "Gun Pack [Cookies: %d]", get_pcvar_num(cvar_gunpackprice))
menu_additem(shopmenu, szText, "9", 0)
menu_setprop(shopmenu, MPROP_EXIT , MEXIT_ALL);
menu_display(id, shopmenu, 0);
}
return PLUGIN_HANDLED
}
public sub_shopmenu(id, shopmenu, item)
{
if (item == MENU_EXIT)
{
menu_destroy(shopmenu);
return PLUGIN_HANDLED;
}
new Data[7], Name[64];
new Access, Callback;
menu_item_getinfo(shopmenu, item, Access, Data,5, Name, 63, Callback);
new Key = str_to_num(Data);
switch (Key)
{
case 1:
{
if(playerpoints[id] < get_pcvar_num(cvar_grenadeprice))
{
#if defined USE_CC
ColorChat(id, RED, "%s You don't have enough^x03 Cookies^x04 to buy that item", PREFIX)
#else
client_print(id, print_chat, "%s You don't got enough Cookies to buy that item", PREFIX)
#endif
return PLUGIN_HANDLED
}
else
{
give_grenade(id)
}
}
case 2:
{
if(playerpoints[id] < get_pcvar_num(cvar_flashprice))
{
#if defined USE_CC
ColorChat(id, RED, "%s You don't have enough^x03 Cookies^x04 to buy that item", PREFIX)
#else
client_print(id, print_chat, "%s You don't got enough Cookies to buy that item", PREFIX)
#endif
return PLUGIN_HANDLED
}
else
{
give_pills(id)
}
}
case 3:
{
if(playerpoints[id] < get_pcvar_num(cvar_pillsprice))
{
#if defined USE_CC
ColorChat(id, RED, "%s You don't have enough^x03 Cookies^x04 to buy that item", PREFIX)
#else
client_print(id, print_chat, "%s You don't got enough Cookies to buy that item", PREFIX)
#endif
return PLUGIN_HANDLED
}
else
{
give_pills(id)
}
}
case 4:
{
if(playerpoints[id] < get_pcvar_num(cvar_nadepackprice))
{
#if defined USE_CC
ColorChat(id, RED, "%s You don't have enough^x03 Cookies^x04 to buy that item", PREFIX)
#else
client_print(id, print_chat, "%s You don't got enough Cookies to buy that item", PREFIX)
#endif
return PLUGIN_HANDLED
}
else
{
give_nadepack(id)
}
}
case 5:
{
if(playerpoints[id] < get_pcvar_num(cvar_gunprice))
{
#if defined USE_CC
ColorChat(id, RED, "%s You don't have enough^x03 Cookies^x04 to buy that item", PREFIX)
#else
client_print(id, print_chat, "%s You don't got enough Cookies to buy that item", PREFIX)
#endif
return PLUGIN_HANDLED
}
else
{
gun_gamble(id)
}
}
case 6:
{
if(playerpoints[id] < get_pcvar_num(cvar_crowprice))
{
#if defined USE_CC
ColorChat(id, RED, "%s You don't have enough^x03 Cookies^x04 to buy that item", PREFIX)
#else
client_print(id, print_chat, "%s You don't got enough Cookies to buy that item", PREFIX)
#endif
return PLUGIN_HANDLED
}
else
{
give_nadepack(id)
}
}
case 7:
{
if(playerpoints[id] < get_pcvar_num(cvar_invprice))
{
#if defined USE_CC
ColorChat(id, RED, "%s You don't have enough^x03 Cookies^x04 to buy that item", PREFIX)
#else
client_print(id, print_chat, "%s You don't got enough Cookies to buy that item", PREFIX)
#endif
return PLUGIN_HANDLED
}
else
{
give_invis(id)
}
}
case 8:
{
if(playerpoints[id] < get_pcvar_num(cvar_camoprice))
{
#if defined USE_CC
ColorChat(id, RED, "%s You don't have enough^x03 Cookies^x04 to buy that item", PREFIX)
#else
client_print(id, print_chat, "%s You don't got enough Cookies to buy that item", PREFIX)
#endif
return PLUGIN_HANDLED
}
else
{
give_camo(id)
}
}
}
menu_destroy(shopmenu);
return PLUGIN_HANDLED;
}
public give_grenade(id)
{
give_item(id, "weapon_hegrenade")
#if defined USE_CC
ColorChat(id, RED, "%s You bought^x03 a Grenade pack", PREFIX)
#else
client_print(id, print_chat, "%s you bought a Grenade pack", PREFIX)
#endif
playerpoints[id] -= get_pcvar_num(cvar_grenadeprice)
return PLUGIN_HANDLED
}
public gun_gamble(id)
{
if(random_num(1, 3) == 1)
{
#if defined USE_CC
ColorChat(id, RED, "%s You gambled for a pistol and^x03 you got it!", PREFIX)
#else
client_print(id, print_chat, "%s You gambled for a pistol and you got it!", PREFIX)
#endif
give_item(id, "weapon_deagle");
}
else
{
user_kill(id)
#if defined USE_CC
ColorChat(id, RED, "%s You gambled for a pistol and^x03 died", PREFIX)
#else
client_print(id, print_chat, "%s You gambled for a pistol and died.", PREFIX)
#endif
}
playerpoints[id] -= get_pcvar_num(cvar_gunprice)
return PLUGIN_HANDLED
}
public give_pills(id)
{
new health = get_user_health(id) + 50
set_user_health(id, health)
#if defined USE_CC
ColorChat(id, RED, "%s You bought^x03 pills.", PREFIX)
#else
client_print(id, print_chat, "%s You bought pills.", PREFIX)
#endif
playerpoints[id] -= get_pcvar_num(cvar_pillsprice)
return PLUGIN_HANDLED
}
public give_invis(id)
{
new AlphaVal = 20
set_bit(g_bHasInvis, id)
set_user_rendering(id,kRenderFxGlowShell,0,0,0,kRenderTransAlpha,AlphaVal)
#if defined USE_CC
ColorChat(id, RED, "%s You bought^x03 Invisibility for 20 sec.", PREFIX)
#else
client_print(id, print_chat, "%s You bought Invisibility for 20 sec.", PREFIX)
#endif
playerpoints[id] -= get_pcvar_num(cvar_invprice)
return PLUGIN_HANDLED
}
public give_camo(id)
{
cs_set_user_model(id, "gign")
got_camo[id] = true
#if defined USE_CC
ColorChat(id, RED, "%s You bought^x03 camo.", PREFIX)
#else
client_print(id, print_chat, "%s You bought camo.", PREFIX)
#endif
playerpoints[id] -= get_pcvar_num(cvar_camoprice)
return PLUGIN_HANDLED
}
public give_nadepack(id)
{
give_item(id, "weapon_flashbang")
give_item(id, "weapon_hegrenade")
give_item(id, "weapon_smokegrenade")
#if defined USE_CC
ColorChat(id, RED, "%s You bought^x03 a nade pack", PREFIX)
#else
client_print(id, print_chat, "%s you bought a nade pack", PREFIX)
#endif
playerpoints[id] -= get_pcvar_num(cvar_nadepackprice)
return PLUGIN_HANDLED
}
////////////////////////////////////////////////////////////////////
//--------------------GIVE/TAKE POINTS----------------------------//
////////////////////////////////////////////////////////////////////
public cmd_give_points(id,level,cid)
{
if(!cmd_access(id,level,cid,3))
return PLUGIN_HANDLED;
new target[32], amount[21], reason[21];
read_argv(1, target, 31 );
read_argv(2, amount, 20 );
read_argv( 3, reason, 20 );
new player = cmd_target( id, target, 8 );
if( ! player )
return PLUGIN_HANDLED;
new admin_name[32], player_name[32];
get_user_name(id, admin_name, 31);
get_user_name(player, player_name, 31);
new pointnum = str_to_num(amount);
playerpoints[player] += pointnum;
switch(get_cvar_num ("amx_show_activity"))
{
case 1: client_print( 0, print_chat, "%s ADMIN: gave %i points for %s.",PREFIX, pointnum, player_name );
case 2: client_print( 0, print_chat, "%s ADMIN %s: gave %i points for %s.",PREFIX, admin_name, pointnum, player_name );
}
client_print(player, print_chat, "%s You received %i points.(Total: %d)",PREFIX, pointnum, playerpoints[player]);
SaveData( id )
return PLUGIN_CONTINUE;
}
public cmd_take_points(id,level,cid)
{
if(!cmd_access (id, level, cid, 3))
return PLUGIN_HANDLED;
new target[32], amount[21], reason[21];
read_argv( 1, target, 31 );
read_argv( 2, amount, 20 );
read_argv( 3, reason, 20 );
new player = cmd_target( id, target, 8 );
if(!player )
return PLUGIN_HANDLED;
new admin_name[32], player_name[32];
get_user_name( id, admin_name, 31 );
get_user_name( player, player_name, 31 );
new pointnum = str_to_num( amount );
playerpoints[player] -= pointnum;
switch(get_cvar_num("amx_show_activity"))
{
case 1: client_print( 0, print_chat, "%s ADMIN: took %i points from %s.",PREFIX, pointnum, player_name );
case 2: client_print( 0, print_chat, "%s ADMIN %s: took %i points from %s.",PREFIX, admin_name, pointnum, player_name );
}
client_print( player, print_chat, "You lost %i points. (Total: %d)", pointnum, playerpoints[player] );
SaveData( id )
return PLUGIN_CONTINUE;
}
////////////////////////////////////////////////////////
//-------------SHOW THE REMAINING PLAYERS-------------//
////////////////////////////////////////////////////////
public players_hud()
{
if(get_pcvar_num(cvar_showplayers))
{
g_prisoners = 0;
g_guards = 0;
for(new i = 0; i < g_max_clients; i++)
{
new id = i;
if(is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_CT)
{
g_guards++;
}
else if(is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_T)
{
g_prisoners++;
}
}
set_hudmessage(0, 255, 0, -1.0, 0.01)
show_hudmessage(0,"Prisoners: %i^nGuards: %i", g_prisoners, g_guards)
}
}
///////////////////////////////////////////////
//----------T GAG BY Exolent[jNr]------------//
///////////////////////////////////////////////
public FwdSetVoice(receiver, sender, bool:listen)
{
if(!get_pcvar_num(cvar_tvoiceblock))
return PLUGIN_HANDLED
if( !(1 <= receiver <= g_max_clients)
|| !g_connected[receiver]
|| !(1 <= sender <= g_max_clients)
|| !g_connected[sender] ) return FMRES_IGNORED;
new CsTeams:team = cs_get_user_team(sender);
if( (team == CS_TEAM_T || team == CS_TEAM_CT && !is_user_alive(sender)) && !access(sender, ADMIN_VOICE) )
{
engfunc(EngFunc_SetClientListening, receiver, sender, 0);
return FMRES_SUPERCEDE;
}
return FMRES_IGNORED;
}
//////////////////////////////////////////////
//------------WEAPON BLOCKER----------------//
//////////////////////////////////////////////
public Event_CurWeapon(id)
{
new weaponID = read_data(2)
if(can_have_gun[id])
return PLUGIN_CONTINUE
if(weaponID != CSW_KNIFE)
client_cmd(id, "weapon_knife")
return PLUGIN_CONTINUE
}