Alguem poderia limitar esses intens pra mim, ou fazer um tutorial.
Esse daqui para comprarem somente 4 vezes
2- nao achei é um plugin de vida com limite.
3- Limitar para comprarem somente 8 vezes
4- Knife blink, Limitar para comprarem somente 7 vezes
5- Granada de alucinação, limitar para comprarem somente 7 vezes
Esse daqui para comprarem somente 4 vezes
Código:
/*
[ZP] Extra Item: Golden Ak 47
Team: Humans
Description: This plugin adds a new weapon for Human Teams.
Weapon Cost: 30
Features:
- This weapon do more damage
- This weapon has zoom
- Launch Lasers
- This weapon has unlimited bullets
Credits:
KaOs - For his Dual MP5 mod
Cvars:
- zp_goldenak_dmg_multiplier <4> - Damage Multiplier for Golden Ak 47
- zp_goldenak_gold_bullets <1|0> - Golden bullets effect ?
- zp_goldenak_custom_model <1|0> - Golden ak Custom Model
- zp_goldenak_unlimited_clip <1|0> - Golden ak Unlimited Clip
*/
#include <amxmodx>
#include <fakemeta>
#include < fun >
#include <hamsandwich>
#include <cstrike>
#include <zombieplague>
#include <colorchat>
#define is_valid_player(%1) (1 <= %1 <= 32)
new AK_V_MODEL[64] = "models/zombie_plague/v_dynamicak_dp.mdl"
new AK_P_MODEL[64] = "models/zombie_plague/p_dynamicak_dp.mdl"
/* Pcvars */
new cvar_dmgmultiplier, cvar_goldbullets, cvar_custommodel, cvar_uclip, cvar_limit
// Item ID
new g_itemid
new bool:g_HasAk[33]
new g_hasZoom[ 33 ]
new bullets[ 33 ]
// Sprite
new m_spriteTexture
const Wep_ak47 = ((1<<CSW_AK47))
public plugin_init()
{
/* CVARS */
cvar_dmgmultiplier = register_cvar("zp_goldenak_dmg_multiplier", "3.5")
cvar_custommodel = register_cvar("zp_goldenak_custom_model", "1")
cvar_goldbullets = register_cvar("zp_goldenak_gold_bullets", "1")
cvar_uclip = register_cvar("zp_goldenak_unlimited_clip", "1")
cvar_limit = register_cvar("zp_goldenak_limit", "4")
// Register The Plugin
register_plugin("[ZP] Extra: Golden Ak 47", "1.1", "AlejandroSk")
// Register Zombie Plague extra item
g_itemid = zp_register_extra_item("Dynamic AK-47", 60, ZP_TEAM_HUMAN)
// Death Msg
register_event("DeathMsg", "Death", "a")
// Weapon Pick Up
register_event("WeapPickup","checkModel","b","1=19")
// Current Weapon Event
register_event("CurWeapon","checkWeapon","be","1=1")
register_event("CurWeapon", "make_tracer", "be", "1=1", "3>0")
// Ham TakeDamage
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
register_forward( FM_CmdStart, "fw_CmdStart" )
RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawnPost", 1)
}
public client_connect(id)
{
g_HasAk[id] = false
}
public client_disconnect(id)
{
g_HasAk[id] = false
}
public Death()
{
g_HasAk[read_data(2)] = false
}
public fwHamPlayerSpawnPost(id)
{
g_HasAk[id] = false
}
public plugin_precache()
{
precache_model(AK_V_MODEL)
precache_model(AK_P_MODEL)
m_spriteTexture = precache_model("sprites/dot.spr")
precache_sound("weapons/zoom.wav")
}
public zp_user_infected_post(id)
{
if (zp_get_user_zombie(id))
{
g_HasAk[id] = false
}
}
public checkModel(id)
{
if ( zp_get_user_zombie(id) )
return PLUGIN_HANDLED
new szWeapID = read_data(2)
if ( szWeapID == CSW_AK47 && g_HasAk[id] == true && get_pcvar_num(cvar_custommodel) )
{
set_pev(id, pev_viewmodel2, AK_V_MODEL)
set_pev(id, pev_weaponmodel2, AK_P_MODEL)
}
return PLUGIN_HANDLED
}
public checkWeapon(id)
{
new plrClip, plrAmmo, plrWeap[32]
new plrWeapId
plrWeapId = get_user_weapon(id, plrClip , plrAmmo)
if (plrWeapId == CSW_AK47 && g_HasAk[id])
{
checkModel(id)
}
else
{
return PLUGIN_CONTINUE
}
if (plrClip == 0 && get_pcvar_num(cvar_uclip))
{
// If the user is out of ammo..
get_weaponname(plrWeapId, plrWeap, 31)
// Get the name of their weapon
give_item(id, plrWeap)
engclient_cmd(id, plrWeap)
engclient_cmd(id, plrWeap)
engclient_cmd(id, plrWeap)
}
return PLUGIN_HANDLED
}
public fw_TakeDamage(victim, inflictor, attacker, Float:damage)
{
if ( is_valid_player( attacker ) && get_user_weapon(attacker) == CSW_AK47 && g_HasAk[attacker] )
{
SetHamParamFloat(4, damage * get_pcvar_float( cvar_dmgmultiplier ) )
}
}
public fw_CmdStart( id, uc_handle, seed )
{
if( !is_user_alive( id ) )
return PLUGIN_HANDLED
if( ( get_uc( uc_handle, UC_Buttons ) & IN_ATTACK2 ) && !( pev( id, pev_oldbuttons ) & IN_ATTACK2 ) )
{
new szClip, szAmmo
new szWeapID = get_user_weapon( id, szClip, szAmmo )
if( szWeapID == CSW_AK47 && g_HasAk[id] == true && !g_hasZoom[id] == true)
{
g_hasZoom[id] = true
cs_set_user_zoom( id, CS_SET_AUGSG552_ZOOM, 0 )
emit_sound( id, CHAN_ITEM, "weapons/zoom.wav", 0.20, 2.40, 0, 100 )
}
else if ( szWeapID == CSW_AK47 && g_HasAk[id] == true && g_hasZoom[id])
{
g_hasZoom[ id ] = false
cs_set_user_zoom( id, CS_RESET_ZOOM, 0 )
}
}
return PLUGIN_HANDLED
}
public make_tracer(id)
{
if (get_pcvar_num(cvar_goldbullets))
{
new clip,ammo
new wpnid = get_user_weapon(id,clip,ammo)
new pteam[16]
get_user_team(id, pteam, 15)
if ((bullets[id] > clip) && (wpnid == CSW_AK47) && g_HasAk[id])
{
new vec1[3], vec2[3]
get_user_origin(id, vec1, 1) // origin; your camera point.
get_user_origin(id, vec2, 4) // termina; where your bullet goes (4 is cs-only)
//BEAMENTPOINTS
message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
write_byte (0) //TE_BEAMENTPOINTS 0
write_coord(vec1[0])
write_coord(vec1[1])
write_coord(vec1[2])
write_coord(vec2[0])
write_coord(vec2[1])
write_coord(vec2[2])
write_short( m_spriteTexture )
write_byte(1) // framestart
write_byte(5) // framerate
write_byte(2) // life
write_byte(10) // width
write_byte(0) // noise
write_byte( 0 ) // r, g, b
write_byte( 206 ) // r, g, b
write_byte( 209 ) // r, g, b
write_byte(200) // brightness
write_byte(150) // speed
message_end()
}
bullets[id] = clip
}
}
public zp_extra_item_selected(player, itemid)
{
if ( itemid == g_itemid )
{
if ( user_has_weapon(player, CSW_AK47) )
{
drop_prim(player)
}
else if (limit_count() > get_pcvar_num(cvar_limit))
{
client_print(player, print_chat, "!g[ZP] !yJa existem muitas !tDynamic AK-47");
return ZP_PLUGIN_HANDLED;
}
give_item(player, "weapon_ak47")
client_print(player, print_chat, "!g[ZP] !yVoce comprou a !tDynamic AK-47 !g[Dano x3]")
g_HasAk[player] = true;
}
return PLUGIN_CONTINUE
}
stock drop_prim(id)
{
new weapons[32], num
get_user_weapons(id, weapons, num)
for (new i = 0; i < num; i++) {
if (Wep_ak47 & (1<<weapons[i]))
{
static wname[32]
get_weaponname(weapons[i], wname, sizeof wname - 1)
engclient_cmd(id, "drop", wname)
}
}
}
limit_count()
{
new i, count = 0;
for(i = 1; i < 33; i++)
{
if(g_HasAk[i])
count++;
}
return count;
}
stock ChatColor(const id, const input[], any:...)
{
new count = 1, players[32]
static msg[191]
vformat(msg, 190, input, 3)
replace_all(msg, 190, "!g", "^4") // Chat Verde
replace_all(msg, 190, "!y", "^1") // Chat Normal
replace_all(msg, 190, "!t", "^3") // Chat Do Time Tr=Vermelho Ct=Azul Spec=Branco
replace_all(msg, 190, "!t2", "^0") // Chat Do Time Tr=Vermelho Ct=Azul Spec=Branco
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();
}
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1034\\ f0\\ fs16 \n\\ par }
*/
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1046\\ f0\\ fs16 \n\\ par }
*/
2- nao achei é um plugin de vida com limite.
3- Limitar para comprarem somente 8 vezes
Código:
#include <amxmodx>
#include <fakemeta>
#include <zombieplague>
new const g_item_name[] = { "Municao Infinita" }
const g_item_cost = 30
#if cellbits == 32
const OFFSET_CLIPAMMO = 51
#else
const OFFSET_CLIPAMMO = 65
#endif
const OFFSET_LINUX_WEAPONS = 4
new const MAXCLIP[] = { -1, 13, -1, 10, 1, 7, -1, 30, 30, 1, 30, 20, 25, 30, 35, 25, 12, 20,
10, 30, 100, 8, 30, 30, 20, 2, 7, 30, 30, -1, 50 }
new g_itemid_infammo, g_has_unlimited_clip[33]
public plugin_init()
{
register_plugin("[ZP] Extra: Municao infinita", "1.0", "MeRcyLeZZ")
g_itemid_infammo = zp_register_extra_item(g_item_name, g_item_cost, ZP_TEAM_HUMAN)
register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
register_message(get_user_msgid("CurWeapon"), "message_cur_weapon")
}
// Player buys our upgrade, set the unlimited ammo flag
public zp_extra_item_selected(player, itemid)
{
if (itemid == g_itemid_infammo)
g_has_unlimited_clip[player] = true
}
// Reset flags for all players on newround
public event_round_start()
{
for (new id; id <= 32; id++) g_has_unlimited_clip[id] = false;
}
// Unlimited clip code
public message_cur_weapon(msg_id, msg_dest, msg_entity)
{
// Player doesn't have the unlimited clip upgrade
if (!g_has_unlimited_clip[msg_entity])
return;
// Player not alive or not an active weapon
if (!is_user_alive(msg_entity) || get_msg_arg_int(1) != 1)
return;
static weapon, clip
weapon = get_msg_arg_int(2) // get weapon ID
clip = get_msg_arg_int(3) // get weapon clip
// Unlimited Clip Ammo
if (MAXCLIP[weapon] > 2) // skip grenades
{
set_msg_arg_int(3, get_msg_argtype(3), MAXCLIP[weapon]) // HUD should show full clip all the time
if (clip < 2) // refill when clip is nearly empty
{
// Get the weapon entity
static wname[32], weapon_ent
get_weaponname(weapon, wname, sizeof wname - 1)
weapon_ent = fm_find_ent_by_owner(-1, wname, msg_entity)
// Set max clip on weapon
fm_set_weapon_ammo(weapon_ent, MAXCLIP[weapon])
}
}
}
// Find entity by its owner (from fakemeta_util)
stock fm_find_ent_by_owner(entity, const classname[], owner)
{
while ((entity = engfunc(EngFunc_FindEntityByString, entity, "classname", classname)) && pev(entity, pev_owner) != owner) {}
return entity;
}
// Set Weapon Clip Ammo
stock fm_set_weapon_ammo(entity, amount)
{
set_pdata_int(entity, OFFSET_CLIPAMMO, amount, OFFSET_LINUX_WEAPONS);
}
4- Knife blink, Limitar para comprarem somente 7 vezes
Código:
#include <amxmodx>
#include <fakemeta>
#include <zombieplague>
#include <chr_engine>
#include <colorchat>
#define MIN_DISTANCE 50
/*================================================================================
[Plugin Customization]
=================================================================================*/
new const g_item_name[] = { "Knife Blink" }
const g_item_cost = 15
const g_iMaxDistance = 300;
/*============================================================================*/
new Float:g_fSpeed = 1000.0;
new Float:g_fDelay = 1.0;
new g_iMaxPlayers;
new g_iEnemy[33];
new g_iInBlink[33];
new Float:g_fLastSlash[33];
new g_iCanceled[33];
new g_iSlash[33];
new g_iBlinks[33];
new g_itemid_blink;
new bought_limit[33], cvar_limit_bought
public plugin_init(){
register_plugin("[ZP] Extra Item: Knife Blink", "1.2", "pharse");
cvar_limit_bought = register_cvar("zp_knife_limit", "6")
g_iMaxPlayers = get_maxplayers();
g_itemid_blink = zp_register_extra_item(g_item_name, g_item_cost, ZP_TEAM_ZOMBIE);
register_forward(FM_TraceLine, "FW_TraceLine_Post", 1);
register_forward(FM_PlayerPreThink, "FW_PlayerPreThink");
register_event("HLTV", "EVENT_round_start", "a", "1=0", "2=0")
}
// ================================================== //
// FORWARDS / EVENTS
// ================================================== //
public FW_TraceLine_Post(Float:start[3], Float:end[3], conditions, id, trace){
if (!CHECK_ValidPlayer(id))
return FMRES_IGNORED;
new iWeaponID = get_user_weapon(id);
if ( iWeaponID != CSW_KNIFE ){
OP_Cancel(id);
return FMRES_IGNORED;
}
new enemy = g_iEnemy[id];
if (!enemy){
enemy = get_tr2(trace, TR_pHit);
if ( !CHECK_ValidPlayer(enemy) || zp_get_user_zombie(enemy) ){
OP_Cancel(id);
return FMRES_IGNORED;
}
g_iEnemy[id] = enemy;
}
return FMRES_IGNORED;
}
public FW_PlayerPreThink(id){
if (!CHECK_ValidPlayer(id))
return FMRES_IGNORED;
new iWeaponID = get_user_weapon(id);
if ( iWeaponID != CSW_KNIFE || !zp_get_user_zombie(id) ){
OP_Cancel(id);
return FMRES_IGNORED;
}
if ( g_iBlinks[id] == 0 )
return FMRES_IGNORED;
new button = pev(id,pev_button);
if ( !(button & IN_ATTACK) && !(button & IN_ATTACK2) ){
OP_Cancel(id)
return FMRES_IGNORED;
}
if (g_iSlash[id])
g_iSlash[id] = 0;
OP_NearEnemy(id);
if( g_iInBlink[id] ){
OP_SetBlink(id);
OP_Blink(id);
g_iCanceled[id] = 0;
}
return FMRES_IGNORED;
}
// Player buys our upgrade, add one blink
public zp_extra_item_selected(player, itemid)
{
if (itemid == g_itemid_blink)
{
g_iBlinks[player] += 1;
bought_limit[player]++
client_print(player, print_chat, "[!gZP!y] !yVoce tem agora !g%d !yKnife Blinks", g_iBlinks[player]);
}
if(bought_limit[player] >= get_pcvar_num(cvar_limit_bought))
{
client_print(player, print_chat, "[ZP] Ja compraram muitas knife blinks")
zp_set_user_ammo_packs(player, zp_get_user_ammo_packs(player) + item_cost)
return;
}
}
// Reset blinks for all players on newround
public EVENT_round_start()
{
for (new id; id <= 32; id++) g_iBlinks[id] = 0;
}
for(new id = 1; id <= get_maxplayers(); id++)
{
g_has[id] = false
bought_limit[id] = 0
}
// ================================================== //
// OPERATIONS
// ================================================== //
public OP_NearEnemy(id){
new enemy = g_iEnemy[id];
new Float:time = get_gametime();
if (!enemy || g_fLastSlash[id]+g_fDelay>time){
g_iInBlink[id] = 0;
return;
}
new origin[3], origin_enemy[3];
get_user_origin(id, origin, 0);
get_user_origin(enemy, origin_enemy, 0);
new distance = get_distance(origin, origin_enemy);
if ( MIN_DISTANCE<=distance<=g_iMaxDistance){
g_iInBlink[id] = 1;
return;
}else if (MIN_DISTANCE>distance && g_iInBlink[id])
{
OP_Slash(id);
}
OP_Cancel(id);
}
public OP_Blink(id){
new Float:new_velocity[3];
new enemy = g_iEnemy[id];
new Float:origin_enemy[3];
pev(enemy, pev_origin, origin_enemy);
entity_set_aim(id, origin_enemy);
get_speed_vector2(id, enemy, g_fSpeed, new_velocity)
set_pev(id, pev_velocity, new_velocity);
}
public OP_Cancel(id){
g_iInBlink[id] = 0;
g_iEnemy[id] = 0;
if (!g_iCanceled[id]){
OP_SetBlink(id);
g_iCanceled[id] = 1;
}
}
public OP_Slash(id){
set_pev(id, pev_velocity, {0.0,0.0,0.0}); // stop player's blink
new weaponID = get_user_weapon(id, _, _);
if(weaponID == CSW_KNIFE){
new weapon[32]
get_weaponname(weaponID,weapon,31)
new ent = fm_find_ent_by_owner(-1,weapon,id)
if(ent){
set_pdata_float(ent,46, 0.0);
set_pdata_float(ent,47, 0.0);
g_iSlash[id] = 1;
g_fLastSlash[id] = get_gametime();
g_iBlinks[id] -= 1;
new name[32];
get_user_name(id,name,31)
client_print(0, print_chat, "[!gZP!y] !g%s !yUsou Knife Blink!", name);
client_print(id, print_chat, "[!gZP!y] !g%d Knife Blinks restante.", g_iBlinks[id]);
}
}
}
public OP_SetBlink(id){
new blink = g_iInBlink[id];
if (blink>1)
return;
if (blink)
g_iInBlink[id] += 1;
}
// ================================================== //
// CHECKS
// ================================================== //
public CHECK_ValidPlayer(id){
if (1<=id<=g_iMaxPlayers && is_user_alive(id))
return 1;
return 0;
}
// from fakemeta_util.inc
stock fm_find_ent_by_owner(index, const classname[], owner, jghgtype = 0) {
new strtype[11] = "classname", ent = index;
switch (jghgtype) {
case 1: strtype = "target";
case 2: strtype = "targetname";
}
while ((ent = engfunc(EngFunc_FindEntityByString, ent, strtype, classname)) && pev(ent, pev_owner) != owner) {}
return ent;
}
stock ChatColor(const id, const input[], any:...)
{
new count = 1, players[32]
static msg[191]
vformat(msg, 190, input, 3)
replace_all(msg, 190, "!g", "^4") // Chat Verde
replace_all(msg, 190, "!y", "^1") // Chat Normal
replace_all(msg, 190, "!t", "^3") // Chat Do Time Tr=Vermelho Ct=Azul Spec=Branco
replace_all(msg, 190, "!t2", "^0") // Chat Do Time Tr=Vermelho Ct=Azul Spec=Branco
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();
}
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1034\\ f0\\ fs16 \n\\ par }
*/
}
5- Granada de alucinação, limitar para comprarem somente 7 vezes
Código:
#include <amxmodx>
#include <fakemeta>
#include < fun >
#include <hamsandwich>
#include <cstrike>
#include <zombieplague>
#define is_valid_player(%1) (1 <= %1 <= 32)
#define ITEM_COST 50
new AK_V_MODEL[64] = "models/zombie_plague/v_golden_ak47.mdl"
new AK_P_MODEL[64] = "models/zombie_plague/p_golden_ak47.mdl"
/* Pcvars */
new cvar_dmgmultiplier, cvar_goldbullets, cvar_custommodel, cvar_uclip, cvar_limit
// Item ID
new g_itemid
new bool:g_HasAk[33]
new g_hasZoom[ 33 ]
new bullets[ 33 ]
// Sprite
new m_spriteTexture
const Wep_ak47 = ((1<<CSW_AK47))
public plugin_init()
{
/* CVARS */
cvar_dmgmultiplier = register_cvar("zp_goldenak_dmg_multiplier", "12")
cvar_custommodel = register_cvar("zp_goldenak_custom_model", "1")
cvar_goldbullets = register_cvar("zp_goldenak_gold_bullets", "1")
cvar_uclip = register_cvar("zp_goldenak_unlimited_clip", "1")
cvar_limit = register_cvar("zp_goldenak_limit", "4")
// Register The Plugin
register_plugin("[ZP] Extra: Golden Ak 47 ", "1.1", "AlejandroSk")
// Register Zombie Plague extra item
g_itemid = zp_register_extra_item("Dynamic AK-47", ITEM_COST, ZP_TEAM_HUMAN)
// Death Msg
register_event("DeathMsg", "Death", "a")
// Weapon Pick Up
register_event("WeapPickup","checkModel","b","1=19")
// Current Weapon Event
register_event("CurWeapon","checkWeapon","be","1=1")
register_event("CurWeapon", "make_tracer", "be", "1=1", "3>0")
// Ham TakeDamage
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
register_forward( FM_CmdStart, "fw_CmdStart" )
RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawnPost", 1)
}
public client_connect(id)
{
g_HasAk[id] = false
}
public client_disconnect(id)
{
g_HasAk[id] = false
}
public Death()
{
g_HasAk[read_data(2)] = false
}
public fwHamPlayerSpawnPost(id)
{
g_HasAk[id] = false
}
public plugin_precache()
{
precache_model(AK_V_MODEL)
precache_model(AK_P_MODEL)
m_spriteTexture = precache_model("sprites/dot.spr")
precache_sound("weapons/zoom.wav")
}
public zp_user_infected_post(id)
{
if (zp_get_user_zombie(id))
{
g_HasAk[id] = false
}
}
public checkModel(id)
{
if ( zp_get_user_zombie(id) )
return PLUGIN_HANDLED
new szWeapID = read_data(2)
if ( szWeapID == CSW_AK47 && g_HasAk[id] == true && get_pcvar_num(cvar_custommodel) )
{
set_pev(id, pev_viewmodel2, AK_V_MODEL)
set_pev(id, pev_weaponmodel2, AK_P_MODEL)
}
return PLUGIN_HANDLED
}
public checkWeapon(id)
{
new plrClip, plrAmmo, plrWeap[32]
new plrWeapId
plrWeapId = get_user_weapon(id, plrClip , plrAmmo)
if (plrWeapId == CSW_AK47 && g_HasAk[id])
{
checkModel(id)
}
else
{
return PLUGIN_CONTINUE
}
if (plrClip == 0 && get_pcvar_num(cvar_uclip))
{
// If the user is out of ammo..
get_weaponname(plrWeapId, plrWeap, 31)
// Get the name of their weapon
give_item(id, plrWeap)
engclient_cmd(id, plrWeap)
engclient_cmd(id, plrWeap)
engclient_cmd(id, plrWeap)
}
return PLUGIN_HANDLED
}
public fw_TakeDamage(victim, inflictor, attacker, Float:damage)
{
if ( is_valid_player( attacker ) && get_user_weapon(attacker) == CSW_AK47 && g_HasAk[attacker] )
{
SetHamParamFloat(4, damage * get_pcvar_float( cvar_dmgmultiplier ) )
}
}
public fw_CmdStart( id, uc_handle, seed )
{
if( !is_user_alive( id ) )
return PLUGIN_HANDLED
if( ( get_uc( uc_handle, UC_Buttons ) & IN_ATTACK2 ) && !( pev( id, pev_oldbuttons ) & IN_ATTACK2 ) )
{
new szClip, szAmmo
new szWeapID = get_user_weapon( id, szClip, szAmmo )
if( szWeapID == CSW_AK47 && g_HasAk[id] == true && !g_hasZoom[id] == true)
{
g_hasZoom[id] = true
cs_set_user_zoom( id, CS_SET_AUGSG552_ZOOM, 0 )
emit_sound( id, CHAN_ITEM, "weapons/zoom.wav", 0.20, 2.40, 0, 100 )
}
else if ( szWeapID == CSW_AK47 && g_HasAk[id] == true && g_hasZoom[id])
{
g_hasZoom[ id ] = false
cs_set_user_zoom( id, CS_RESET_ZOOM, 0 )
}
}
return PLUGIN_HANDLED
}
public make_tracer(id)
{
if (get_pcvar_num(cvar_goldbullets))
{
new clip,ammo
new wpnid = get_user_weapon(id,clip,ammo)
new pteam[16]
get_user_team(id, pteam, 15)
if ((bullets[id] > clip) && (wpnid == CSW_AK47) && g_HasAk[id])
{
new vec1[3], vec2[3]
get_user_origin(id, vec1, 1) // origin; your camera point.
get_user_origin(id, vec2, 4) // termina; where your bullet goes (4 is cs-only)
//BEAMENTPOINTS
message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
write_byte (0)
write_coord(vec1[0])
write_coord(vec1[1])
write_coord(vec1[2])
write_coord(vec2[0])
write_coord(vec2[1])
write_coord(vec2[2])
write_short( m_spriteTexture )
write_byte(1) // framestart
write_byte(5) // framerate
write_byte(2) // life
write_byte(10) // width
write_byte(0) // noise
write_byte( 0 ) // r, g, b
write_byte( 206 ) // r, g, b
write_byte( 209 ) // r, g, b
write_byte(200) // brightness
write_byte(150) // speed
message_end()
}
bullets[id] = clip
}
}
public zp_extra_item_selected(player, itemid)
{
if ( itemid == g_itemid )
{
if ( user_has_weapon(player, CSW_AK47) )
{
drop_prim(player)
}
else if (limit_count() > get_pcvar_num(cvar_limit))
{
client_print(player, print_chat, "!g[ZP] !yJa existem muitas !tDynamic-AK47");
return ZP_PLUGIN_HANDLED;
}
give_item(player, "weapon_ak47")
client_print(player, print_chat, "!g[ZP] !yVoce comprou uma !tDynamic AK 47 New !g[Dano x3]")
g_HasAk[player] = true;
}
return PLUGIN_CONTINUE
}
stock drop_prim(id)
{
new weapons[32], num
get_user_weapons(id, weapons, num)
for (new i = 0; i < num; i++) {
if (Wep_ak47 & (1<<weapons[i]))
{
static wname[32]
get_weaponname(weapons[i], wname, sizeof wname - 1)
engclient_cmd(id, "drop", wname)
}
}
}
limit_count()
{
new i, count = 0;
for(i = 1; i < 33; i++)
{
if(g_HasAk[i])
count++;
}
}