Raised This Month: $ Target: $400
 0% 

[ZP] Ayuda cuando compro un item recivo ammo packs (Solucionado)


  
 
 
Thread Tools Display Modes
Desktop
AlliedModders Donor
Join Date: Sep 2009
Location: C:\Users\Default\
Old 04-06-2013 , 12:18   Re: [ZP] Ayuda cuando compro un item recivo ammo packs
#11

seguro hacés g_ammopacks[index] += ArrayGetCell(blabla) en vez de -=
__________________
Massive Infection:: Piu-Games
Desktop is offline
LeeanAndNeka
Senior Member
Join Date: Feb 2012
Location: Argentina ♥
Old 04-06-2013 , 15:32   Re: [ZP] Ayuda cuando compro un item recivo ammo packs
#12

g_ammopacks[ index ] = g_ammopacks[ index ] + ArrayGetCell(blabla).
Le asigno a g_ammopacks[ index ] su contenido mas ArrayGetCell(blabla).
LeeanAndNeka is offline
Send a message via MSN to LeeanAndNeka Send a message via Skype™ to LeeanAndNeka
Shybrid
Junior Member
Join Date: Mar 2013
Old 04-06-2013 , 21:06  
#13

Estaba buscando el g_ammopacks[index] y no esta y no se si es este:
g_ammopacks[id] += ArrayGetCell(g_extraitem_cost, itemid)

Esta en += y lo cambia a -= lo guarde y compile y anda igual, recivo 35 ap cuando compro Zombie Dinner Scanner y cuando compro Antidote bomb me quita 10 ap en ves de 60 que es lo que cuesta.

(Ex-Solucion): Bueno, yo pensaba que era el motor del zp, el sma porque hace unos dias atras habia modificado el hud info y resulto ser que no era.
entonces medio por desactivas algunos zp extra items aver si era eso y desactive la mayoria, menos Zombie Dinner Scanner, y cuando creo la partida y compro el dinner scanner me quita los 15 ap, en ves de que reciva los 35, pero ahora yo no se cual de todos los plugins que desactive es el que me esta fallando.

Abajo se los dejo.
PD: los que tienen ; son los que estan desactivados.


PHP Code:
;zm_vip.amxx
;zm_vip_extra_adv_antidotegun.amxx
;zm_vip_extra_bazooka.amxx
;zm_vip_extra_buy_survnem.amxx
;zm_vip_extra_chainsaw.amxx
;zm_vip_extra_flamethrower.amxx
;zm_vip_extra_gc_extra_item_ng.amxx  #ATENCION!!! No Activar.
;zm_vip_extra_goldendg.amxx
;zm_vip_extra_human_armor.amxx
;zm_vip_extra_lasersight.amxx
;zm_vip_extra_plasma_rifle.amxx
;zm_vip_extra_playeraura.amxx
;zm_vip_extra_unlimited_clip.amxx
;zm_vip_extra_weapons.amxx
;zm_vip_zkill_bomb_v1-2.amxx
;zp_extra_unlimited_clip.amxx
;zp_extra_human_armor.amxx
;First_Aid_Kit_L4D_V2.amxx
zp_extra_batteries
.amxx
zp_extraitem_silent_hill_radio
.amxx
zp_extra_radar_experimental
.amxx
zp_extra_hp
.amxx
;zp_extra_choose_low_gravity.amxx
zp_extra_radar_zombie
.amxx
zp_extra_lasermine
.amxx
zp_extra_sandbags
.amxx
;zp_extra_pipe.amxx
;zp_extra_candle.amxx
;zp_extra_sniper_pack.amxx
;zp_extra_m16.amxx
wegn_silverm4a1
.amxx
;zp_extra_goldendg.amxx
;Golden_xm1014.amxx
;zp_extra_Golden_MP5.amxx
;zp_extra_goldenak.amxx
;zp_extra_goldenm4.amxx
;zp_extra_GoldenAWP.amxx
zp_extra_ioncannon
.amxx
zp_extra_antidotebomb
.amxx
zp_extra_adv_antidotegun
.amxx
zp_killbomb
.amxx
;zp_extra_buy_nem-surv.amxx 

Last edited by lucas_7_94; 04-06-2013 at 22:03.
Shybrid is offline
SoldierPRO
Junior Member
Join Date: Mar 2013
Location: Monterrey N.L
Old 04-09-2013 , 22:26   Re: [ZP] Ayuda cuando compro un item recivo ammo packs
#14

Osea amigo no entendi muy bien
__________________
SoldierPRO Helping people to have a good server
SoldierPRO is offline
Send a message via MSN to SoldierPRO Send a message via Skype™ to SoldierPRO
Shybrid
Junior Member
Join Date: Mar 2013
Old 04-10-2013 , 12:38   Re: [ZP] Ayuda cuando compro un item recivo ammo packs
#15

Quote:
Originally Posted by SoldierPRO View Post
Osea amigo no entendi muy bien
Que cuando compro algo como Radar zombie recivo 35 ap en vez de que mi quite 15 ap que es lo que cuesta, y cuando compro Antidoto bomba me quita 10 ap en vez de 60 que es lo que cuesta.
Shybrid is offline
Shybrid
Junior Member
Join Date: Mar 2013
Old 04-10-2013 , 13:59   Re: [ZP] Ayuda cuando compro un item recivo ammo packs
#16

Aqui esta el problema: zp extra GoldenAWP, cuando tengo activo este zp extra item se descontrolan los ammopacks, y cuando lo desactivo todo vuelve normal, no se porque pero ya todo volvio a la normalidad.

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <engine>
#include <fakemeta>
#include <hamsandwich>
#include <zombieplague>

// Plug info.
#define PLUG_VERSION "1.0"
#define PLUG_AUTH "H.RED.ZONE"

#define is_valid_player(%1) (1 <= %1 <= 32)

// Items Cost

const GoldenAWP_weapon_cost 50  // Cost

//----------------
new g_iItemIDg_msgCurWeapon
new bullets33 ]

new 
g_HasGoldenAWPWeapon[33], g_CurrentWeapon[33]

// Cvars
new cvar_enablecvar_oneroundcvar_dmgmultipliercvar_goldbulletscvar_uclip

// Offsets
const m_pPlayer =         41
const m_flNextPrimaryAttack =     46
const m_flNextSecondaryAttack =    47
const m_flTimeWeaponIdle =     48

// Sprite
new m_spriteTexture

public plugin_init()
{
    
//Register the Plugin
    
register_plugin("[ZP] Extra Item: GoldenAWP""1.0""H.RED.ZONE")
    
    
//Cvars
    
cvar_enable register_cvar("zp_GoldenAWP_enable""1")
    
cvar_oneround register_cvar("zp_GoldenAWP_oneround""1")
    
cvar_goldbullets register_cvar("zp_GoldenAWP_gold_bullets""1")
    
cvar_uclip register_cvar("zp_GoldenAWP_unlimited_clip""1")
    
cvar_dmgmultiplier register_cvar("zp_GoldenAWP_dmg_multiplier""3")
    
    
//Register Zombie Plague extra item
    
g_iItemID zp_register_extra_item("GoldenAWP"GoldenAWP_weapon_costZP_TEAM_HUMAN)
    
    
//Hamsandwich
    
RegisterHam(Ham_Spawn"player""fw_PlayerSpawn_Post"1)
    
RegisterHam(Ham_Killed"player""fw_PlayerKilled")
    
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage")
    
    
//Message ID
    
g_msgCurWeapon get_user_msgid("CurWeapon")
    
    
//Events
    
register_event("CurWeapon""event_CurWeapon""b""1=1")    
    
    
//Messages
    
register_message(get_user_msgid("DeathMsg"), "message_DeathMsg")
}

public 
plugin_precache()
{
    
// Hamsandwich Forwards
    
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage")
    
    
// Models
    
precache_model("models/zombie_plague/v_GoldenAWP.mdl")
}

public 
event_CurWeapon(id)
{
    
// Not Alive
    
if (!is_user_alive(id))
        return 
PLUGIN_CONTINUE
    
    
// Store weapon
    
g_CurrentWeapon[id] = read_data(2)
    
    
// Check
    
if(zp_get_user_zombie(id) || zp_get_user_survivor(id))
        return 
PLUGIN_CONTINUE
    
    
// Has GoldenAWP
    
if(!g_HasGoldenAWPWeapon[id] || g_CurrentWeapon[id] != CSW_AWP
        return 
PLUGIN_CONTINUE
    
    entity_set_string
(idEV_SZ_viewmodel"models/zombie_plague/v_GoldenAWP.mdl")
    
    return 
PLUGIN_CONTINUE
}

public 
message_DeathMsg(msg_idmsg_destid)
{
    static 
szTruncatedWeapon[33], iAttackeriVictim
    
    
// Get truncated weapon
    
get_msg_arg_string(4szTruncatedWeaponcharsmax(szTruncatedWeapon))
    
    
// Get attacker and victim
    
iAttacker get_msg_arg_int(1)
    
iVictim get_msg_arg_int(2)
    
    
// Non-player
    
if(!is_user_connected(iAttacker) || iAttacker == iVictim)
        return 
PLUGIN_CONTINUE
    
    
return PLUGIN_CONTINUE
}

public 
client_putinserver(id)
{
    
g_HasGoldenAWPWeapon[id] = false
}

public 
client_disconnect(id)
{
    
g_HasGoldenAWPWeapon[id] = false
}
public 
fw_PlayerSpawn_Post(id)
{
    
// Remove Weapon
    
if(get_pcvar_num(cvar_oneround) || !get_pcvar_num(cvar_enable))
    {
        if(
g_HasGoldenAWPWeapon[id])
        {
            
g_HasGoldenAWPWeapon[id] = false;
            
ham_strip_weapon(id"weapon_awp")
        }
    }
}

public 
fw_PlayerKilled(victimattackershouldgib)
{
    if(!
is_user_connected(attacker) || !is_user_connected(victim) || attacker == victim || !attacker)
        return 
HAM_IGNORED
    
    
// Victim has a GoldenAWP
    
if(g_HasGoldenAWPWeapon[victim])
    {
        
client_print(victimprint_center"[Golden] Power")
        
g_HasGoldenAWPWeapon[victim] = false
    
}
    
    
// Attacker has a GoldenAWP
    
if(g_HasGoldenAWPWeapon[attacker] && g_CurrentWeapon[attacker] == CSW_AWP)
    {
        
// Get Victim's Origin, Give AP cvar status and AP cvar amount
        
static iOrigin[3]
        
get_user_origin(victimiOrigin)
        
    }
    
    return 
HAM_IGNORED
}


stock ham_strip_weapon(idweapon[])
{
    if(!
equal(weapon,"weapon_",7)) 
        return 
0
    
    
new wId get_weaponid(weapon)
    
    if(!
wId) return 0
    
    
new wEnt
    
    
while((wEnt find_ent_by_class(wEntweapon)) && entity_get_edict(wEntEV_ENT_owner) != id) {}
    
    if(!
wEnt) return 0
    
    
if(get_user_weapon(id) == wId
        
ExecuteHamB(Ham_Weapon_RetireWeapon,wEnt);
    
    if(!
ExecuteHamB(Ham_RemovePlayerItem,id,wEnt)) 
        return 
0
    
    ExecuteHamB
(Ham_Item_KillwEnt)
    
    
entity_set_int(idEV_INT_weaponsentity_get_int(idEV_INT_weapons) & ~(1<<wId))
    
    return 
1
}

public 
fw_TakeDamage(victiminflictorattackerFloat:damage)
{
    if ( 
is_valid_playerattacker ) && get_user_weapon(attacker) == CSW_AWP && g_HasGoldenAWPWeapon[attacker] )
    {
        
SetHamParamFloat(4damage get_pcvar_floatcvar_dmgmultiplier ) )
    }
}
public 
zp_user_infected_post(id)
{
    
// Has a Golden Weapon
    
if(g_HasGoldenAWPWeapon[id])
        
g_HasGoldenAWPWeapon[id] = false
}

public 
zp_user_humanized_post(id)
{
    
// Has a Golden Weapon
    
if(g_HasGoldenAWPWeapon[id])
        
g_HasGoldenAWPWeapon[id] = false;
}
stock ham_give_weapon(idweapon[])
{
    if(!
equal(weapon,"weapon_",7)) 
        return 
0
    
    
new wEnt create_entity(weapon)
    
    if(!
is_valid_ent(wEnt)) 
        return 
0
    
    entity_set_int
(wEntEV_INT_spawnflagsSF_NORESPAWN)
    
DispatchSpawn(wEnt)
    
    if(!
ExecuteHamB(Ham_AddPlayerItem,id,wEnt))
    {
        if(
is_valid_ent(wEnt)) entity_set_int(wEntEV_INT_flagsentity_get_int(wEntEV_INT_flags) | FL_KILLME)
        return 
0
    
}
    
    
ExecuteHamB(Ham_Item_AttachToPlayer,wEnt,id)
    return 
1
}

public 
zp_extra_item_selected(iditem)
{
    
// GoldenAWP Weapon
    
if (item == g_iItemID)
    {
        if(
g_HasGoldenAWPWeapon[id] && user_has_weapon(idCSW_AWP))
        {
            
zp_set_user_ammo_packs(idzp_get_user_ammo_packs(id) + GoldenAWP_weapon_cost)
            
            return;
        }
        
        
// Var's
        
g_HasGoldenAWPWeapon[id] = true
        
        
// AWP
        
ham_give_weapon(id"weapon_awp")
        
cs_set_user_bpammo(idCSW_AWP30)
        
        
// Msgs
        
client_print(idprint_center"Power ON. Seek and Destroy")
        
        
// Updating Models
        
static iAwpID 
        iAwpID 
find_ent_by_owner(-1"weapon_awp"id)
        
        
ExecuteHamB(Ham_Item_DeployiAwpID)
        
        
engclient_cmd(id"weapon_awp")
        
emessage_begin(MSG_ONEg_msgCurWeapon_id)
        
ewrite_byte(1// active
        
ewrite_byte(CSW_AWP// weapon
        
ewrite_byte(cs_get_weapon_ammo(iAwpID)) // clip
        
emessage_end()
    }
    else
    {
        
zp_set_user_ammo_packs(idzp_get_user_ammo_packs(id) + GoldenAWP_weapon_cost)
    }
}
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(idpteam15)
        
        if ((
bullets[id] > clip) && (wpnid == CSW_AWP) && g_HasGoldenAWPWeapon[id]) 
        {
            new 
vec1[3], vec2[3]
            
get_user_origin(idvec11// origin; your camera point.
            
get_user_origin(idvec24// termina; where your bullet goes (4 is cs-only)
            
            
            //BEAMENTPOINTS
            
message_beginMSG_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_shortm_spriteTexture )
            
write_byte(1// framestart
            
write_byte(5// framerate
            
write_byte(2// life
            
write_byte(10// width
            
write_byte(0// noise
            
write_byte255 )     // r, g, b
            
write_byte215 )       // r, g, b
            
write_byte)       // r, g, b
            
write_byte(200// brightness
            
write_byte(150// speed
            
message_end()
        }
    
        
bullets[id] = clip
    
}
    
}
public 
checkWeapon(id)
{
    new 
plrClipplrAmmoplrWeap[32]
    new 
plrWeapId
    
    plrWeapId 
get_user_weapon(idplrClip plrAmmo)
    
    if (
plrWeapId == CSW_AWP && g_HasGoldenAWPWeapon[id])
    {
        return 
PLUGIN_CONTINUE
    
}
    
    if (
plrClip == && get_pcvar_num(cvar_uclip))
    {
        
// If the user is out of ammo..
        
get_weaponname(plrWeapIdplrWeap31)
        
// Get the name of their weapon
        
ham_give_weapon(idplrWeap)
        
engclient_cmd(idplrWeap
        
engclient_cmd(idplrWeap)
        
engclient_cmd(idplrWeap)
    }
    return 
PLUGIN_HANDLED
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1034\\ f0\\ fs16 \n\\ par }
*/ 
Solucion: No activar el zp extra GoldenAWP hasta nueva solucion.

Last edited by Shybrid; 04-10-2013 at 14:03.
Shybrid is offline
LuKks
Senior Member
Join Date: Dec 2012
Location: Argentina, Santa Fe
Old 04-10-2013 , 18:06   Re: [ZP] Ayuda cuando compro un item recivo ammo packs
#17

compila y proba.
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <engine>
#include <fakemeta>
#include <hamsandwich>
#include <zombieplague>

// Plug info.
#define PLUG_VERSION "1.0"
#define PLUG_AUTH "H.RED.ZONE"

#define is_valid_player(%1) (1 <= %1 <= 32)

// Items Cost

const GoldenAWP_weapon_cost 50  // Cost

//----------------
new g_iItemIDg_msgCurWeapon
new bullets33 ]

new 
g_HasGoldenAWPWeapon[33], g_CurrentWeapon[33]

// Cvars
new cvar_enablecvar_oneroundcvar_dmgmultipliercvar_goldbulletscvar_uclip

// Offsets
const m_pPlayer =         41
const m_flNextPrimaryAttack =     46
const m_flNextSecondaryAttack =    47
const m_flTimeWeaponIdle =     48

// Sprite
new m_spriteTexture

public plugin_init()
{
    
//Register the Plugin
    
register_plugin("[ZP] Extra Item: GoldenAWP""1.0""H.RED.ZONE")
    
    
//Cvars
    
cvar_enable register_cvar("zp_GoldenAWP_enable""1")
    
cvar_oneround register_cvar("zp_GoldenAWP_oneround""1")
    
cvar_goldbullets register_cvar("zp_GoldenAWP_gold_bullets""1")
    
cvar_uclip register_cvar("zp_GoldenAWP_unlimited_clip""1")
    
cvar_dmgmultiplier register_cvar("zp_GoldenAWP_dmg_multiplier""3")
    
    
//Register Zombie Plague extra item
    
g_iItemID zp_register_extra_item("GoldenAWP"GoldenAWP_weapon_costZP_TEAM_HUMAN)
    
    
//Hamsandwich
    
RegisterHam(Ham_Spawn"player""fw_PlayerSpawn_Post"1)
    
RegisterHam(Ham_Killed"player""fw_PlayerKilled")
    
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage")
    
    
//Message ID
    
g_msgCurWeapon get_user_msgid("CurWeapon")
    
    
//Events
    
register_event("CurWeapon""event_CurWeapon""b""1=1")    
    
    
//Messages
    
register_message(get_user_msgid("DeathMsg"), "message_DeathMsg")
}

public 
plugin_precache()
{
    
// Hamsandwich Forwards
    
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage")
    
    
// Models
    
precache_model("models/zombie_plague/v_GoldenAWP.mdl")
}

public 
event_CurWeapon(id)
{
    
// Not Alive
    
if (!is_user_alive(id))
        return 
PLUGIN_CONTINUE
    
    
// Store weapon
    
g_CurrentWeapon[id] = read_data(2)
    
    
// Check
    
if(zp_get_user_zombie(id) || zp_get_user_survivor(id))
        return 
PLUGIN_CONTINUE
    
    
// Has GoldenAWP
    
if(!g_HasGoldenAWPWeapon[id] || g_CurrentWeapon[id] != CSW_AWP
        return 
PLUGIN_CONTINUE
    
    entity_set_string
(idEV_SZ_viewmodel"models/zombie_plague/v_GoldenAWP.mdl")
    
    return 
PLUGIN_CONTINUE
}

public 
message_DeathMsg(msg_idmsg_destid)
{
    static 
szTruncatedWeapon[33], iAttackeriVictim
    
    
// Get truncated weapon
    
get_msg_arg_string(4szTruncatedWeaponcharsmax(szTruncatedWeapon))
    
    
// Get attacker and victim
    
iAttacker get_msg_arg_int(1)
    
iVictim get_msg_arg_int(2)
    
    
// Non-player
    
if(!is_user_connected(iAttacker) || iAttacker == iVictim)
        return 
PLUGIN_CONTINUE
    
    
return PLUGIN_CONTINUE
}

public 
client_putinserver(id)
{
    
g_HasGoldenAWPWeapon[id] = false
}

public 
client_disconnect(id)
{
    
g_HasGoldenAWPWeapon[id] = false
}
public 
fw_PlayerSpawn_Post(id)
{
    
// Remove Weapon
    
if(get_pcvar_num(cvar_oneround) || !get_pcvar_num(cvar_enable))
    {
        if(
g_HasGoldenAWPWeapon[id])
        {
            
g_HasGoldenAWPWeapon[id] = false;
            
ham_strip_weapon(id"weapon_awp")
        }
    }
}

public 
fw_PlayerKilled(victimattackershouldgib)
{
    if(!
is_user_connected(attacker) || !is_user_connected(victim) || attacker == victim || !attacker)
        return 
HAM_IGNORED
    
    
// Victim has a GoldenAWP
    
if(g_HasGoldenAWPWeapon[victim])
    {
        
client_print(victimprint_center"[Golden] Power")
        
g_HasGoldenAWPWeapon[victim] = false
    
}
    
    
// Attacker has a GoldenAWP
    
if(g_HasGoldenAWPWeapon[attacker] && g_CurrentWeapon[attacker] == CSW_AWP)
    {
        
// Get Victim's Origin, Give AP cvar status and AP cvar amount
        
static iOrigin[3]
        
get_user_origin(victimiOrigin)
        
    }
    
    return 
HAM_IGNORED
}


stock ham_strip_weapon(idweapon[])
{
    if(!
equal(weapon,"weapon_",7)) 
        return 
0
    
    
new wId get_weaponid(weapon)
    
    if(!
wId) return 0
    
    
new wEnt
    
    
while((wEnt find_ent_by_class(wEntweapon)) && entity_get_edict(wEntEV_ENT_owner) != id) {}
    
    if(!
wEnt) return 0
    
    
if(get_user_weapon(id) == wId
        
ExecuteHamB(Ham_Weapon_RetireWeapon,wEnt);
    
    if(!
ExecuteHamB(Ham_RemovePlayerItem,id,wEnt)) 
        return 
0
    
    ExecuteHamB
(Ham_Item_KillwEnt)
    
    
entity_set_int(idEV_INT_weaponsentity_get_int(idEV_INT_weapons) & ~(1<<wId))
    
    return 
1
}

public 
fw_TakeDamage(victiminflictorattackerFloat:damage)
{
    if ( 
is_valid_playerattacker ) && get_user_weapon(attacker) == CSW_AWP && g_HasGoldenAWPWeapon[attacker] )
    {
        
SetHamParamFloat(4damage get_pcvar_floatcvar_dmgmultiplier ) )
    }
}
public 
zp_user_infected_post(id)
{
    
// Has a Golden Weapon
    
if(g_HasGoldenAWPWeapon[id])
        
g_HasGoldenAWPWeapon[id] = false
}

public 
zp_user_humanized_post(id)
{
    
// Has a Golden Weapon
    
if(g_HasGoldenAWPWeapon[id])
        
g_HasGoldenAWPWeapon[id] = false;
}
stock ham_give_weapon(idweapon[])
{
    if(!
equal(weapon,"weapon_",7)) 
        return 
0
    
    
new wEnt create_entity(weapon)
    
    if(!
is_valid_ent(wEnt)) 
        return 
0
    
    entity_set_int
(wEntEV_INT_spawnflagsSF_NORESPAWN)
    
DispatchSpawn(wEnt)
    
    if(!
ExecuteHamB(Ham_AddPlayerItem,id,wEnt))
    {
        if(
is_valid_ent(wEnt)) entity_set_int(wEntEV_INT_flagsentity_get_int(wEntEV_INT_flags) | FL_KILLME)
        return 
0
    
}
    
    
ExecuteHamB(Ham_Item_AttachToPlayer,wEnt,id)
    return 
1
}

public 
zp_extra_item_selected(iditem)
{
    
// GoldenAWP Weapon
    
if (item == g_iItemID)
    {
        if(
g_HasGoldenAWPWeapon[id] && user_has_weapon(idCSW_AWP))
        {
            
zp_set_user_ammo_packs(idzp_get_user_ammo_packs(id) - GoldenAWP_weapon_cost)
            
            return;
        }
        
        
// Var's
        
g_HasGoldenAWPWeapon[id] = true
        
        
// AWP
        
ham_give_weapon(id"weapon_awp")
        
cs_set_user_bpammo(idCSW_AWP30)
        
        
// Msgs
        
client_print(idprint_center"Power ON. Seek and Destroy")
        
        
// Updating Models
        
static iAwpID 
        iAwpID 
find_ent_by_owner(-1"weapon_awp"id)
        
        
ExecuteHamB(Ham_Item_DeployiAwpID)
        
        
engclient_cmd(id"weapon_awp")
        
emessage_begin(MSG_ONEg_msgCurWeapon_id)
        
ewrite_byte(1// active
        
ewrite_byte(CSW_AWP// weapon
        
ewrite_byte(cs_get_weapon_ammo(iAwpID)) // clip
        
emessage_end()
    }
    else
    {
        
zp_set_user_ammo_packs(idzp_get_user_ammo_packs(id) - GoldenAWP_weapon_cost)
    }
}
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(idpteam15)
        
        if ((
bullets[id] > clip) && (wpnid == CSW_AWP) && g_HasGoldenAWPWeapon[id]) 
        {
            new 
vec1[3], vec2[3]
            
get_user_origin(idvec11// origin; your camera point.
            
get_user_origin(idvec24// termina; where your bullet goes (4 is cs-only)
            
            
            //BEAMENTPOINTS
            
message_beginMSG_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_shortm_spriteTexture )
            
write_byte(1// framestart
            
write_byte(5// framerate
            
write_byte(2// life
            
write_byte(10// width
            
write_byte(0// noise
            
write_byte255 )     // r, g, b
            
write_byte215 )       // r, g, b
            
write_byte)       // r, g, b
            
write_byte(200// brightness
            
write_byte(150// speed
            
message_end()
        }
    
        
bullets[id] = clip
    
}
    
}
public 
checkWeapon(id)
{
    new 
plrClipplrAmmoplrWeap[32]
    new 
plrWeapId
    
    plrWeapId 
get_user_weapon(idplrClip plrAmmo)
    
    if (
plrWeapId == CSW_AWP && g_HasGoldenAWPWeapon[id])
    {
        return 
PLUGIN_CONTINUE
    
}
    
    if (
plrClip == && get_pcvar_num(cvar_uclip))
    {
        
// If the user is out of ammo..
        
get_weaponname(plrWeapIdplrWeap31)
        
// Get the name of their weapon
        
ham_give_weapon(idplrWeap)
        
engclient_cmd(idplrWeap
        
engclient_cmd(idplrWeap)
        
engclient_cmd(idplrWeap)
    }
    return 
PLUGIN_HANDLED
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\ rtf1\ ansi\ deff0{\ fonttbl{\ f0\ fnil Tahoma;}}n\ viewkind4\ uc1\ pard\ lang1034\ f0\ fs16 n\ par }
*/ 
LuKks is offline
baneado
Veteran Member
Join Date: Dec 2012
Location: amxmodx-es.com
Old 04-11-2013 , 11:55   Re: [ZP] Ayuda cuando compro un item recivo ammo packs
#18

PHP Code:
zp_set_user_ammo_packs(idzp_get_user_ammo_packs(id) + GoldenAWP_weapon_cost
-->

PHP Code:
zp_set_user_ammo_packs(idzp_get_user_ammo_packs(id) - GoldenAWP_weapon_cost
lukks si solo hay que cambiar dos líneas dile cuales y ya está, no hace falta que le pases todo el código de nuevo


A parte el zp te resta automáticamente los ammopacks así que no hace falta esas líneas, bórralas

Last edited by baneado; 04-11-2013 at 11:55.
baneado is offline
Shybrid
Junior Member
Join Date: Mar 2013
Old 04-11-2013 , 19:17   Re: [ZP] Ayuda cuando compro un item recivo ammo packs
#19

Solucionado.

Cerrado.
Shybrid is offline
LuKks
Senior Member
Join Date: Dec 2012
Location: Argentina, Santa Fe
Old 04-11-2013 , 20:18   Re: [ZP] Ayuda cuando compro un item recivo ammo packs (Solucionado)
#20

baneado yo se que solo habia que hacer eso pero talves el creador del thread no lo sepa hacer muy bien y me asegure de que no lo haga mal y por eso le pase todo el code completo..

shybrid di como lo solucionaste talves alguien tenga el mimso problema o quiera este item extra y tenga el mismo problema y lo quiera solucionar.
LuKks is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:12.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode