Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[ZP]: Sniper Laser Gun
#1
Arkadaşlar bende zp_extra_SLG diye bir plugin var.Bu pluginde mermi sayısını sınırlı(5 mermi,0 şarjör) gibi ve damage ayarınının değiştirilebilir olmasını istiyorum elimde sadece .sma dosyası var.Editleyebilirseniz çok güzel olur.

[HTML]#include <amxmodx>
#include <zombieplague>
#include <fun>
#include <cstrike>
#include <engine>
#include <hamsandwich>
#include <fakemeta>

/* [ZP] Extra Item : Sniper Laser Gun [SLG] ! By xLeoNNN. (san antonio,chile)
this is my second plugin, the Sniper Laser Gun [SLG] is a weapon awp with efects,laser,
Credits :

meTaLiCroSS : for code of damage of "gauss"
Mr.Death : how to create the effects and use the "Temp Entity"
*/

new g_ibuy
new bullets[33]
new hotflarex, laserb, thunder
new bool:g_lasergun[33]
new g_iMaxPlayers
const q_pPlayer = 41
new Shakes
const Second = ( 1<<10 )
new cvar_particles_dead, cvar_bullet_efect, cvar_thunder, cvar_oneround
new g_currentweapon[33]

new V_LASERGUN[] = "models/zombie_plague/v_sniper_laser_gun.mdl"
new P_LASERGUN[] = "models/zombie_plague/p_sniper_laser_gun.mdl"
new W_LASERGUN[] = "models/zombie_plague/w_sniper_laser_gun.mdl"
new const LaserSound[] = "weapons/electro4.wav"

public plugin_init()
{
register_plugin("[ZP] Extra Item: Sniper Laser Gun", "1.0", "x[L]eoNNN")
g_ibuy = zp_register_extra_item("Sniper Laser Gun", 40, ZP_TEAM_HUMAN)
Shakes = get_user_msgid( "ScreenShake" )
register_event("CurWeapon", "make_tracer", "be", "1=1", "3>0")
register_event("CurWeapon", "Event_CurWeapon", "be","1=1")
register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_awp", "fw_AWP_PrimaryAttack_Post", 1)
RegisterHam(Ham_Spawn, "player", "fw_PlayerSpawn_Post", 1)
register_forward(FM_SetModel, "fw_SetModel")
cvar_particles_dead = register_cvar("zp_slg_particles", "1")
cvar_bullet_efect = register_cvar("zp_slg_bullet", "1")
cvar_thunder = register_cvar("zp_slg_thunder", "1")
cvar_oneround = register_cvar("zp_slg_oneround", "1")

}

public plugin_precache()
{
hotflarex = precache_model("sprites/flare6.spr")
laserb = precache_model("sprites/laserbeam.spr")
thunder = precache_model("sprites/zbeam1.spr")
precache_model(V_LASERGUN)
precache_model(P_LASERGUN)
precache_model(W_LASERGUN)
precache_sound(LaserSound)
}

public zp_extra_item_selected(id, itemid)
{

if (itemid ==g_ibuy)
{
g_lasergun[id] = true
give_item (id, "weapon_awp")
cs_set_user_bpammo(id, CSW_AWP, 20)
client_print(id, print_center, "[ZP] Sniper Laser Gun ON! Killed All Zombies!")
}

if(g_lasergun[id] && user_has_weapon(id, CSW_AWP))
{
client_print(id, print_chat, "/g[ZP]/y You Already Have Sniper Laser Gun!")
zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) + 40)
return;
}
}

public zp_user_infected_post(infected, infector)
{
if (g_lasergun[infected])
{
g_lasergun[infected] = false
}
}

public event_round_start()
{
for (new i = 1; i <= g_iMaxPlayers; i++)
{
if (!is_user_connected(i))
continue

if (g_lasergun)
{
g_lasergun = false
}
}
}

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

public client_disconnect(id)
{
g_lasergun[id] = false
}

public make_tracer(id)
{
if(get_pcvar_num(cvar_bullet_efect))
{
if(g_lasergun[id] && g_currentweapon[id])
{
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_AWP))
{
new laser1[3], laser2[3]
get_user_origin(id, laser1, 1)
get_user_origin(id, laser2, 4)

message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
write_byte (1)
write_short(id | 0x1000)
write_coord (laser2[0])
write_coord (laser2[1])
write_coord (laser2[2])
write_short( laserb )
write_byte(1)
write_byte(5)
write_byte(1)
write_byte(80)
write_byte(20)
write_byte(0)
write_byte(52)
write_byte(255)
write_byte(255)
write_byte(150)
message_end()

message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_DLIGHT)
write_coord(laser1[0])
write_coord(laser1[1])
write_coord(laser1[2])
write_byte(13)
write_byte(254)
write_byte(0)
write_byte(0)
write_byte(100)
write_byte(10)
message_end()

message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_SPRITETRAIL)
write_coord(laser1[0])
write_coord(laser1[1])
write_coord(laser1[2])
write_coord(laser1[0])
write_coord(laser1[1])
write_coord(laser1[2])
write_short(hotflarex)
write_byte(5)
write_byte(1)
write_byte(3)
write_byte(34)
write_byte(43)
message_end()
emit_sound(id, CHAN_AUTO, LaserSound, VOL_NORM, ATTN_NORM , 0, PITCH_NORM)

}
bullets[id] = clip
}
}
}

public Event_CurWeapon(id)
{
g_currentweapon[id] = read_data(2)

if(!g_lasergun[id] || g_currentweapon[id] != CSW_AWP)
return PLUGIN_CONTINUE

entity_set_string(id, EV_SZ_viewmodel, V_LASERGUN)
entity_set_string(id, EV_SZ_weaponmodel, P_LASERGUN)

return PLUGIN_CONTINUE
}

public fw_SetModel(entity, model[])
{
if(!is_valid_ent(entity))
return FMRES_IGNORED


if(!equali(model, "models/w_awp.mdl"))
return FMRES_IGNORED;

new ads = entity_get_edict(entity, EV_ENT_owner)
new className[33]
entity_get_string(entity, EV_SZ_classname, className, 32)

if(equal(className, "weaponbox") || equal(className, "armoury_entity") || equal(className, "grenade"))
{
if(g_lasergun[ads])
{
entity_set_model(entity, W_LASERGUN)
return FMRES_SUPERCEDE
}
}

return FMRES_IGNORED
}

public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_bits)
{
if(!is_user_connected(attacker) || !is_user_connected(victim) || zp_get_user_nemesis(victim) || attacker == victim || !attacker)
return HAM_IGNORED

if (g_lasergun[attacker] && g_currentweapon[attacker] == CSW_AWP)
{
static Float:originF[3]
pev(victim, pev_origin, originF)

new plrWeapId, plrClip, plrAmmo
plrWeapId = get_user_weapon(attacker, plrClip, plrAmmo)
if (plrWeapId == CSW_AWP)
SetHamParamFloat(4, damage += get_user_health(victim))

client_print(attacker, print_center, "Enemy Electrocuted!")
if(get_pcvar_num(cvar_particles_dead))
dead_efect(originF)
}

if(zp_get_user_nemesis(victim))
{
client_print(attacker, print_center, "Nemesis is Inmune")
}
return PLUGIN_HANDLED;
}

dead_efect(const Float:originF[3])
{
engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, originF, 0)
write_byte(TE_PARTICLEBURST)
engfunc(EngFunc_WriteCoord, originF[0])
engfunc(EngFunc_WriteCoord, originF[1])
engfunc(EngFunc_WriteCoord, originF[2]+10)
write_short(250)
write_byte(70)
write_byte(55)
message_end()

engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, originF, 0)
write_byte(TE_PARTICLEBURST)
engfunc(EngFunc_WriteCoord, originF[0])
engfunc(EngFunc_WriteCoord, originF[1])
engfunc(EngFunc_WriteCoord, originF[2]+10)
write_short(250)
write_byte(70)
write_byte(55)
message_end()

engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, originF, 0)
write_byte(TE_PARTICLEBURST)
engfunc(EngFunc_WriteCoord, originF[0])
engfunc(EngFunc_WriteCoord, originF[1])
engfunc(EngFunc_WriteCoord, originF[2]+10)
write_short(250)
write_byte(83)
write_byte(55)
message_end()

engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, originF, 0)
write_byte(TE_IMPLOSION)
engfunc(EngFunc_WriteCoord, originF[0])
engfunc(EngFunc_WriteCoord, originF[1])
engfunc(EngFunc_WriteCoord, originF[2]+10)
write_byte(random_num(100, 300))
write_byte(20)
write_byte(3)
message_end()
}

public fw_AWP_PrimaryAttack_Post(awp)
{
if(get_pcvar_num(cvar_thunder))
{
static id
id = get_pdata_cbase(awp, q_pPlayer, 4)

if(is_user_connected(id) && g_lasergun[id])
{
new iEndOrigin[3]
get_user_origin(id, iEndOrigin, 3)

message_begin(MSG_BROADCAST, SVC_TEMPENTITY, iEndOrigin)
write_byte(TE_EXPLOSION)
write_coord(iEndOrigin[0])
write_coord(iEndOrigin[1])
write_coord(iEndOrigin[2] +10)
write_short(thunder)
write_byte(90)
write_byte(60)
write_byte(TE_EXPLFLAG_NONE)
message_end()

message_begin(MSG_BROADCAST, SVC_TEMPENTITY, iEndOrigin)
write_byte(TE_EXPLOSION)
write_coord(iEndOrigin[0])
write_coord(iEndOrigin[1])
write_coord(iEndOrigin[2]+20)
write_short(thunder)
write_byte(60)
write_byte(20)
write_byte(TE_EXPLFLAG_NONE)
message_end()

message_begin(MSG_BROADCAST, SVC_TEMPENTITY, iEndOrigin)
write_byte(TE_EXPLOSION)
write_coord(iEndOrigin[0])
write_coord(iEndOrigin[1])
write_coord(iEndOrigin[2] +30)
write_short(thunder)
write_byte(60)
write_byte(20)
write_byte(TE_EXPLFLAG_NONE)
message_end()

message_begin(MSG_BROADCAST, SVC_TEMPENTITY, iEndOrigin)
write_byte(TE_BEAMCYLINDER)
write_coord(iEndOrigin[0])
write_coord(iEndOrigin[1])
write_coord(iEndOrigin[2])
write_coord(iEndOrigin[0])
write_coord(iEndOrigin[1])
write_coord(iEndOrigin[2]+200)
write_short(hotflarex)
write_byte(0)
write_byte(1)
write_byte(6)
write_byte(8)
write_byte(1)
write_byte(255)
write_byte(255)
write_byte(192)
write_byte(128)
write_byte(5)
message_end()

message_begin( MSG_ONE_UNRELIABLE, Shakes, _, id )
write_short( Second*5 )
write_short( Second*5 )
write_short( Second*5 )
message_end( )
}
}
}

public fw_PlayerSpawn_Post(id)
{
if(get_pcvar_num(cvar_oneround))
{
if(g_lasergun[id])
{
g_lasergun[id] = false
ham_strip_weapon(id, "weapon_awp")
}
}
}

stock ham_strip_weapon(id, weapon[])
{
if(!equal(weapon,"weapon_",7))
return 0

new idd = get_weaponid(weapon)

if(!idd) return 0

new wEnt

while((wEnt = find_ent_by_class(wEnt, weapon)) && entity_get_edict(wEnt, EV_ENT_owner) != id) {}

if(!wEnt) return 0

if(get_user_weapon(id) == idd)
ExecuteHamB(Ham_Weapon_RetireWeapon,wEnt);

if(!ExecuteHamB(Ham_RemovePlayerItem,id,wEnt))
return 0

ExecuteHamB(Ham_Item_Kill, wEnt)

entity_set_int(id, EV_INT_weapons, entity_get_int(id, EV_INT_weapons) & ~(1<<idd))

return 1
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1034\\ f0\\ fs16 \n\\ par }
*/
[/HTML]
[/i]
Reply
#2
PHP Code:
#include <amxmodx>
#include <zombieplague>
#include <fun>
#include <cstrike>
#include <engine>
#include <hamsandwich>
#include <fakemeta>

/* [ZP] Extra Item : Sniper Laser Gun [SLG] ! By xLeoNNN. (san antonio,chile)
   this is my second plugin, the Sniper Laser Gun [SLG] is a weapon awp with efects,laser,
   Credits : 
   
   meTaLiCroSS  :  for code of damage of "gauss"
   Mr.Death     :  how to create the effects and use the "Temp Entity"
   */
   
new g_ibuy
new cvar_limit,cvar_damage;
new 
used[33];
new 
bullets[33]
new 
hotflarexlaserbthunder
new bool:g_lasergun[33]
new 
g_iMaxPlayers
const q_pPlayer 41
new Shakes
const Second = ( 1<<10 )
new 
cvar_particles_deadcvar_bullet_efectcvar_thundercvar_oneround
new g_currentweapon[33]

new 
V_LASERGUN[] = "models/zombie_plague/v_sniper_laser_gun.mdl" 
new P_LASERGUN[]        = "models/zombie_plague/p_sniper_laser_gun.mdl"
new W_LASERGUN[]    = "models/zombie_plague/w_sniper_laser_gun.mdl"
new const LaserSound[] = "weapons/electro4.wav"

public plugin_init()
{
    
register_plugin("[ZP] Extra Item: Sniper Laser Gun""1.0""x[L]eoNNN"
    
g_ibuy zp_register_extra_item("Sniper Laser Gun"40ZP_TEAM_HUMAN)
    
Shakes get_user_msgid"ScreenShake" )
    
register_event("CurWeapon""make_tracer""be""1=1""3>0")
    
register_event("CurWeapon""Event_CurWeapon""be","1=1")
    
register_event("HLTV""event_round_start""a""1=0""2=0")
    
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage")
    
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_awp""fw_AWP_PrimaryAttack_Post"1)
    
RegisterHam(Ham_Spawn"player""fw_PlayerSpawn_Post"1)
    
register_forward(FM_SetModel"fw_SetModel")
    
cvar_particles_dead register_cvar("zp_slg_particles""1")
    
cvar_bullet_efect register_cvar("zp_slg_bullet""1")
    
cvar_thunder register_cvar("zp_slg_thunder""1")
    
cvar_oneround register_cvar("zp_slg_oneround""1")
    
cvar_damage register_cvar("zp_slg_damage","1000.0")
    
cvar_limit register_cvar("zp_slg_limit","8")
    
}

public 
plugin_precache()
{
    
hotflarex precache_model("sprites/flare6.spr")
    
laserb precache_model("sprites/laserbeam.spr")
    
thunder precache_model("sprites/zbeam1.spr")
    
precache_model(V_LASERGUN)
    
precache_model(P_LASERGUN)
    
precache_model(W_LASERGUN)
    
precache_sound(LaserSound)
}

public 
zp_extra_item_selected(iditemid
{
    
    if (
itemid ==g_ibuy)
    {
        
g_lasergun[id] = true
        give_item 
(id"weapon_awp")
        
cs_set_user_bpammo(idCSW_AWP20)
        
client_print(idprint_center"[ZP] Sniper Laser Gun ON! Killed All Zombies!")
    }
    
    if(
g_lasergun[id] && user_has_weapon(idCSW_AWP))
    {
        
client_print(idprint_chat"/g[ZP]/y You Already Have Sniper Laser Gun!")
        
zp_set_user_ammo_packs(idzp_get_user_ammo_packs(id) + 40)
        return;
    }


public 
zp_user_infected_post(infectedinfector)
{
    if (
g_lasergun[infected])
    {
        
g_lasergun[infected] = false
    
}
}

public 
event_round_start()
{
    for (new 
1<= g_iMaxPlayersi++)
    {
        if (!
is_user_connected(i))
            continue
        
        if (
g_lasergun[i])
        {
            
g_lasergun false
        
}
        
used 0;
    }
}

public 
client_putinserver(id)
{
    
used[id] = 0;
    
g_lasergun[id] = false
}

public 
client_disconnect(id)
{
    
g_lasergun[id] = false
}

public 
make_tracer(id)
{
    if(
get_pcvar_num(cvar_bullet_efect))
    {
        if(
g_lasergun[id] && g_currentweapon[id])
        {
            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)) 
            {
                new 
laser1[3], laser2[3]
                
get_user_origin(idlaser11)
                
get_user_origin(idlaser24)
                
                
message_beginMSG_BROADCAST,SVC_TEMPENTITY)
                
write_byte (1)    
                
write_short(id 0x1000
                
write_coord (laser2[0]) 
                
write_coord (laser2[1])
                
write_coord (laser2[2])
                
write_shortlaserb )
                
write_byte(1
                
write_byte(5
                
write_byte(1
                
write_byte(80
                
write_byte(20
                
write_byte(0)    
                
write_byte(52)       
                
write_byte(255)      
                
write_byte(255
                
write_byte(150)
                
message_end()
                
                
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
                
write_byte(TE_DLIGHT
                
write_coord(laser1[0]) 
                
write_coord(laser1[1]) 
                
write_coord(laser1[2]) 
                
write_byte(13
                
write_byte(254)
                
write_byte(0)
                
write_byte(0
                
write_byte(100)
                
write_byte(10)
                
message_end()
                
                
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
                
write_byte(TE_SPRITETRAIL)
                
write_coord(laser1[0]) 
                
write_coord(laser1[1]) 
                
write_coord(laser1[2]) 
                
write_coord(laser1[0]) 
                
write_coord(laser1[1]) 
                
write_coord(laser1[2]) 
                
write_short(hotflarex)
                
write_byte(5)
                
write_byte(1
                
write_byte(3
                
write_byte(34)
                
write_byte(43)
                
message_end()
                
emit_sound(idCHAN_AUTOLaserSoundVOL_NORMATTN_NORM 0PITCH_NORM)
                
            }
            
bullets[id] = clip
        
}
    }
}

public 
Event_CurWeapon(id
{      
    
g_currentweapon[id] = read_data(2)
    
    if(!
g_lasergun[id] || g_currentweapon[id] != CSW_AWP)
        return 
PLUGIN_CONTINUE
    
    entity_set_string
(idEV_SZ_viewmodelV_LASERGUN)
    
entity_set_string(idEV_SZ_weaponmodelP_LASERGUN)
    
    return 
PLUGIN_CONTINUE 
}

public 
fw_SetModel(entitymodel[])
{
    if(!
is_valid_ent(entity))
        return 
FMRES_IGNORED
    
    
    
if(!equali(model"models/w_awp.mdl")) 
        return 
FMRES_IGNORED;
    
    new 
ads entity_get_edict(entityEV_ENT_owner)
    new 
className[33]
    
entity_get_string(entityEV_SZ_classnameclassName32)
    
    if(
equal(className"weaponbox") || equal(className"armoury_entity") || equal(className"grenade"))
    {
        if(
g_lasergun[ads])
        {
            
entity_set_model(entityW_LASERGUN)
            return 
FMRES_SUPERCEDE
        
}
    }
    
    return 
FMRES_IGNORED


public 
fw_TakeDamage(victiminflictorattackerFloat:damagedamage_bits)
{
    if(!
is_user_connected(attacker) || !is_user_connected(victim) || zp_get_user_nemesis(victim) || attacker == victim || !attacker)
        return 
HAM_IGNORED
    
    
if (g_lasergun[attacker] && g_currentweapon[attacker] == CSW_AWP)
    {    
        static 
Float:originF[3]
        
pev(victimpev_originoriginF)
        
        new 
plrWeapIdplrClipplrAmmo
        plrWeapId 
get_user_weapon(attackerplrClipplrAmmo)
        if (
plrWeapId == CSW_AWP)
            
SetHamParamFloat(4damage get_pcvar_float(cvar_damage))
        
        
client_print(attackerprint_center"Enemy Electrocuted!")
        if(
get_pcvar_num(cvar_particles_dead))
            
dead_efect(originF)
    }
    
    if(
zp_get_user_nemesis(victim))
    {
        
client_print(attackerprint_center"Nemesis is Inmune")
    }
    return 
PLUGIN_HANDLED
}

dead_efect(const Float:originF[3])
{    
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)            
    
write_byte(TE_PARTICLEBURST
    
engfunc(EngFunc_WriteCoordoriginF[0])
    
engfunc(EngFunc_WriteCoordoriginF[1]) 
    
engfunc(EngFunc_WriteCoordoriginF[2]+10
    
write_short(250
    
write_byte(70
    
write_byte(55
    
message_end()
    
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)            
    
write_byte(TE_PARTICLEBURST
    
engfunc(EngFunc_WriteCoordoriginF[0])
    
engfunc(EngFunc_WriteCoordoriginF[1]) 
    
engfunc(EngFunc_WriteCoordoriginF[2]+10)
    
write_short(250
    
write_byte(70
    
write_byte(55
    
message_end()
    
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)            
    
write_byte(TE_PARTICLEBURST)
    
engfunc(EngFunc_WriteCoordoriginF[0]) 
    
engfunc(EngFunc_WriteCoordoriginF[1]) 
    
engfunc(EngFunc_WriteCoordoriginF[2]+10)
    
write_short(250)
    
write_byte(83
    
write_byte(55)
    
message_end()
    
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
    
write_byte(TE_IMPLOSION)
    
engfunc(EngFunc_WriteCoordoriginF[0]) 
    
engfunc(EngFunc_WriteCoordoriginF[1]) 
    
engfunc(EngFunc_WriteCoordoriginF[2]+10
    
write_byte(random_num(100300))
    
write_byte(20
    
write_byte(3
    
message_end()
}

public 
fw_AWP_PrimaryAttack_Post(awp)
{
    static 
id
    id 
get_pdata_cbase(awpq_pPlayer4)
    if(
used[id] >= get_pcvar_num(cvar_limit)) {
        
client_print(id,print_chat,"Bu Silahi Kullanma Limitiniz Doldu !")
        return 
HAM_IGNORED
    
}
    
used[id]++;
    
    if(
get_pcvar_num(cvar_thunder))
    {
        
        
        if(
is_user_connected(id) && g_lasergun[id])
        {    
            new 
iEndOrigin[3]
            
get_user_origin(idiEndOrigin3)
            
            
message_begin(MSG_BROADCASTSVC_TEMPENTITYiEndOrigin
            
write_byte(TE_EXPLOSION)    
            
write_coord(iEndOrigin[0]) 
            
write_coord(iEndOrigin[1]) 
            
write_coord(iEndOrigin[2] +10
            
write_short(thunder)    
            
write_byte(90)        
            
write_byte(60)        
            
write_byte(TE_EXPLFLAG_NONE)    
            
message_end() 
            
            
message_begin(MSG_BROADCASTSVC_TEMPENTITYiEndOrigin
            
write_byte(TE_EXPLOSION)    
            
write_coord(iEndOrigin[0]) 
            
write_coord(iEndOrigin[1]) 
            
write_coord(iEndOrigin[2]+20
            
write_short(thunder)    
            
write_byte(60)    
            
write_byte(20)        
            
write_byte(TE_EXPLFLAG_NONE)    
            
message_end() 
            
            
message_begin(MSG_BROADCASTSVC_TEMPENTITYiEndOrigin
            
write_byte(TE_EXPLOSION)    
            
write_coord(iEndOrigin[0]) 
            
write_coord(iEndOrigin[1]) 
            
write_coord(iEndOrigin[2] +30
            
write_short(thunder)    
            
write_byte(60)        
            
write_byte(20)            
            
write_byte(TE_EXPLFLAG_NONE)    
            
message_end() 
            
            
message_begin(MSG_BROADCASTSVC_TEMPENTITYiEndOrigin
            
write_byte(TE_BEAMCYLINDER)
            
write_coord(iEndOrigin[0])
            
write_coord(iEndOrigin[1])
            
write_coord(iEndOrigin[2])
            
write_coord(iEndOrigin[0])
            
write_coord(iEndOrigin[1])
            
write_coord(iEndOrigin[2]+200)
            
write_short(hotflarex)
            
write_byte(0)
            
write_byte(1)
            
write_byte(6)
            
write_byte(8)
            
write_byte(1)
            
write_byte(255)
            
write_byte(255)
            
write_byte(192)
            
write_byte(128)
            
write_byte(5)
            
message_end()
            
            
message_beginMSG_ONE_UNRELIABLEShakes_id )
            
write_shortSecond*)
            
write_shortSecond*)
            
write_shortSecond*)
            
message_end( ) 
        }
    }
}

public 
fw_PlayerSpawn_Post(id)
{
if(
get_pcvar_num(cvar_oneround))
{
    if(
g_lasergun[id])
    {
        
g_lasergun[id] = false
        ham_strip_weapon
(id"weapon_awp")
    }
}
}

stock ham_strip_weapon(idweapon[])
{
    if(!
equal(weapon,"weapon_",7)) 
        return 
0
    
    
new idd get_weaponid(weapon)
    
    if(!
idd) 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) == idd
        
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<<idd))
    
    return 
1
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1034\\ f0\\ fs16 \n\\ par }
*/ 

Denemeye fırsatım olmadı. Bir dene bak. Amxx istersen ekte.[/i][/i][/i]


CS:GO ve CS 1.6 için ücretli eklenti yapılır.
Plugin yazmak isteyenlere yardımcı olabilirim.
Skype adresimden ulaşabilirsiniz:
destek_596
Steam: http://steamcommunity.com/id/ca-nemesis/

Reply
#3
Sanırsam yapabileceğinin en iyisi bu.Ben xDclan zombie serverında görmüştüm böyle bir plugin.8 Mermisi vardı zombilere tek atıyordu 8 mermi sonra silahı atmak zorunda kalıyordun.Eğer elinden gelen bu kadarsa buda olur?

---------- Alttaki Mesaj Zamani 20:56 ---------- Önceki Mesaj Zamani 20:40 ----------

Bu plugin sanırsam buglu daha sonra uğraşabilirsen çok iyi olur.Çünkü şöyle bir sorun var
bu itemi alırken ammo gitmiyor, başka item aldığımda ise ammo gideceğine ammo geliyor.
Reply
#4
nomaxx dateline='' Wrote: Sanırsam yapabileceğinin en iyisi bu.Ben xDclan zombie serverında görmüştüm böyle bir plugin.8 Mermisi vardı zombilere tek atıyordu 8 mermi sonra silahı atmak zorunda kalıyordun.Eğer elinden gelen bu kadarsa buda olur?

---------- Alttaki Mesaj Zamani 20:56 ---------- Önceki Mesaj Zamani 20:40 ----------

Bu plugin sanırsam buglu daha sonra uğraşabilirsen çok iyi olur.Çünkü şöyle bir sorun var
bu itemi alırken ammo gitmiyor, başka item aldığımda ise ammo gideceğine ammo geliyor.

Yapabileceğimin en iyisi bu değil. Senin isteğin doğrultusunda yaptığım bu. Silahın otomatik atılmasını isteseydiniz onu da yapardım fakat istemediniz. Biz de kahin değiliz.
Plugini ben yapmadım ama bu itemin diğer itemleri etkilediğini sanmıyorum.


CS:GO ve CS 1.6 için ücretli eklenti yapılır.
Plugin yazmak isteyenlere yardımcı olabilirim.
Skype adresimden ulaşabilirsiniz:
destek_596
Steam: http://steamcommunity.com/id/ca-nemesis/

Reply
#5
Ben size tam olarak isteğimi şöyle açıklayayım.
Ammo miktarı ayarlanabilir olsun,
Silahın mermisi bitince silah otomatik olarak kaybolsun,
cvar komutlarıyla;
mermi sayısı ve damage miktarı ayarlansın.
Benim isteklerim bunlar fakat şimdi denerken farkettim ki bu itemi aldığımda ne ammo gidiyor ne ammo geliyor, başka item aldığımda ise sadece ammo geliyor..
Reply
#6
Quote:Ammo miktarı ayarlanabilir olsun,
Silahın mermisi bitince silah otomatik olarak kaybolsun,

bunlar yapılır fakat bug kısmı için bir şey diyemem. Pluginde sorun yok.

Bu itemi almaya çalıştığında ne yazıyor peki ?


CS:GO ve CS 1.6 için ücretli eklenti yapılır.
Plugin yazmak isteyenlere yardımcı olabilirim.
Skype adresimden ulaşabilirsiniz:
destek_596
Steam: http://steamcommunity.com/id/ca-nemesis/

Reply
#7
Silahı aldığımda sol altta (say) kısmında:/g[ZP]/y You Already Have Sniper Laser Gun!

Ekranın ortasında ise: [ZP]Sniper Laser Gun ON! Killed All Zombies!

yazıyor ve Bu silah elime iken item aldığımda ammo geliyor, silahı atıyorum tekrar item aldığımda ammom gidiyor.Bu silahı aldığımda ammom sabit kalıyor.
Reply
#8
PHP Code:
#include <amxmodx>
#include <zombieplague>
#include <fun>
#include <cstrike>
#include <engine>
#include <hamsandwich>
#include <fakemeta>

/* [ZP] Extra Item : Sniper Laser Gun [SLG] ! By xLeoNNN. (san antonio,chile)
   this is my second plugin, the Sniper Laser Gun [SLG] is a weapon awp with efects,laser,
   Credits : 
   
   meTaLiCroSS  :  for code of damage of "gauss"
   Mr.Death     :  how to create the effects and use the "Temp Entity"
   */
   
new g_ibuy
new cvar_limit,cvar_damage;
new 
used[33];
new 
bullets[33]
new 
hotflarexlaserbthunder
new bool:g_lasergun[33]
new 
g_iMaxPlayers
const q_pPlayer 41
new Shakes
const Second = ( 1<<10 )
new 
cvar_particles_deadcvar_bullet_efectcvar_thundercvar_oneround
new g_currentweapon[33]

new 
V_LASERGUN[] = "models/zombie_plague/v_sniper_laser_gun.mdl" 
new P_LASERGUN[]        = "models/zombie_plague/p_sniper_laser_gun.mdl"
new W_LASERGUN[]    = "models/zombie_plague/w_sniper_laser_gun.mdl"
new const LaserSound[] = "weapons/electro4.wav"

public plugin_init()
{
    
register_plugin("[ZP] Extra Item: Sniper Laser Gun""1.0""x[L]eoNNN"
    
g_ibuy zp_register_extra_item("Sniper Laser Gun"40ZP_TEAM_HUMAN)
    
Shakes get_user_msgid"ScreenShake" )
    
register_event("CurWeapon""make_tracer""be""1=1""3>0")
    
register_event("CurWeapon""Event_CurWeapon""be","1=1")
    
register_event("HLTV""event_round_start""a""1=0""2=0")
    
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage")
    
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_awp""fw_AWP_PrimaryAttack_Post"1)
    
RegisterHam(Ham_Spawn"player""fw_PlayerSpawn_Post"1)
    
register_forward(FM_SetModel"fw_SetModel")
    
cvar_particles_dead register_cvar("zp_slg_particles""1")
    
cvar_bullet_efect register_cvar("zp_slg_bullet""1")
    
cvar_thunder register_cvar("zp_slg_thunder""1")
    
cvar_oneround register_cvar("zp_slg_oneround""1")
    
cvar_damage register_cvar("zp_slg_damage","1000.0")
    
cvar_limit register_cvar("zp_slg_limit","8")
    
}

public 
plugin_precache()
{
    
hotflarex precache_model("sprites/flare6.spr")
    
laserb precache_model("sprites/laserbeam.spr")
    
thunder precache_model("sprites/zbeam1.spr")
    
precache_model(V_LASERGUN)
    
precache_model(P_LASERGUN)
    
precache_model(W_LASERGUN)
    
precache_sound(LaserSound)
}

public 
zp_extra_item_selected(iditemid
{
    
    if (
itemid ==g_ibuy)
    {
        
        if(
g_lasergun[id] && user_has_weapon(idCSW_AWP))
        {
            
client_print(idprint_chat"/g[ZP]/y You Already Have Sniper Laser Gun!")
            
zp_set_user_ammo_packs(idzp_get_user_ammo_packs(id) + 40)
        }
        else {
        
            
g_lasergun[id] = true
            give_item 
(id"weapon_awp")
            
cs_set_user_bpammo(idCSW_AWP20)
            
client_print(idprint_center"[ZP] Sniper Laser Gun ON! Killed All Zombies!")
        }
    }
    
    


public 
zp_user_infected_post(infectedinfector)
{
    if (
g_lasergun[infected])
    {
        
g_lasergun[infected] = false
    
}
}

public 
event_round_start()
{
    for (new 
1<= g_iMaxPlayersi++)
    {
        if (!
is_user_connected(i))
            continue
        
        if (
g_lasergun[i])
        {
            
g_lasergun false
        
}
        
used 0;
    }
}

public 
client_putinserver(id)
{
    
used[id] = 0;
    
g_lasergun[id] = false
}

public 
client_disconnect(id)
{
    
g_lasergun[id] = false
}

public 
make_tracer(id)
{
    if(
get_pcvar_num(cvar_bullet_efect))
    {
        if(
g_lasergun[id] && g_currentweapon[id])
        {
            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)) 
            {
                new 
laser1[3], laser2[3]
                
get_user_origin(idlaser11)
                
get_user_origin(idlaser24)
                
                
message_beginMSG_BROADCAST,SVC_TEMPENTITY)
                
write_byte (1)    
                
write_short(id 0x1000
                
write_coord (laser2[0]) 
                
write_coord (laser2[1])
                
write_coord (laser2[2])
                
write_shortlaserb )
                
write_byte(1
                
write_byte(5
                
write_byte(1
                
write_byte(80
                
write_byte(20
                
write_byte(0)    
                
write_byte(52)       
                
write_byte(255)      
                
write_byte(255
                
write_byte(150)
                
message_end()
                
                
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
                
write_byte(TE_DLIGHT
                
write_coord(laser1[0]) 
                
write_coord(laser1[1]) 
                
write_coord(laser1[2]) 
                
write_byte(13
                
write_byte(254)
                
write_byte(0)
                
write_byte(0
                
write_byte(100)
                
write_byte(10)
                
message_end()
                
                
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
                
write_byte(TE_SPRITETRAIL)
                
write_coord(laser1[0]) 
                
write_coord(laser1[1]) 
                
write_coord(laser1[2]) 
                
write_coord(laser1[0]) 
                
write_coord(laser1[1]) 
                
write_coord(laser1[2]) 
                
write_short(hotflarex)
                
write_byte(5)
                
write_byte(1
                
write_byte(3
                
write_byte(34)
                
write_byte(43)
                
message_end()
                
emit_sound(idCHAN_AUTOLaserSoundVOL_NORMATTN_NORM 0PITCH_NORM)
                
            }
            
bullets[id] = clip
        
}
    }
}

public 
Event_CurWeapon(id
{      
    
g_currentweapon[id] = read_data(2)
    
    if(!
g_lasergun[id] || g_currentweapon[id] != CSW_AWP)
        return 
PLUGIN_CONTINUE
    
    entity_set_string
(idEV_SZ_viewmodelV_LASERGUN)
    
entity_set_string(idEV_SZ_weaponmodelP_LASERGUN)
    
    return 
PLUGIN_CONTINUE 
}

public 
fw_SetModel(entitymodel[])
{
    if(!
is_valid_ent(entity))
        return 
FMRES_IGNORED
    
    
    
if(!equali(model"models/w_awp.mdl")) 
        return 
FMRES_IGNORED;
    
    new 
ads entity_get_edict(entityEV_ENT_owner)
    new 
className[33]
    
entity_get_string(entityEV_SZ_classnameclassName32)
    
    if(
equal(className"weaponbox") || equal(className"armoury_entity") || equal(className"grenade"))
    {
        if(
g_lasergun[ads])
        {
            
entity_set_model(entityW_LASERGUN)
            return 
FMRES_SUPERCEDE
        
}
    }
    
    return 
FMRES_IGNORED


public 
fw_TakeDamage(victiminflictorattackerFloat:damagedamage_bits)
{
    if(!
is_user_connected(attacker) || !is_user_connected(victim) || zp_get_user_nemesis(victim) || attacker == victim || !attacker)
        return 
HAM_IGNORED
    
    
if (g_lasergun[attacker] && g_currentweapon[attacker] == CSW_AWP)
    {    
        static 
Float:originF[3]
        
pev(victimpev_originoriginF)
        
        new 
plrWeapIdplrClipplrAmmo
        plrWeapId 
get_user_weapon(attackerplrClipplrAmmo)
        if (
plrWeapId == CSW_AWP)
            
SetHamParamFloat(4damage get_pcvar_float(cvar_damage))
        
        
client_print(attackerprint_center"Enemy Electrocuted!")
        if(
get_pcvar_num(cvar_particles_dead))
            
dead_efect(originF)
    }
    
    if(
zp_get_user_nemesis(victim))
    {
        
client_print(attackerprint_center"Nemesis is Inmune")
    }
    return 
PLUGIN_HANDLED
}

dead_efect(const Float:originF[3])
{    
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)            
    
write_byte(TE_PARTICLEBURST
    
engfunc(EngFunc_WriteCoordoriginF[0])
    
engfunc(EngFunc_WriteCoordoriginF[1]) 
    
engfunc(EngFunc_WriteCoordoriginF[2]+10
    
write_short(250
    
write_byte(70
    
write_byte(55
    
message_end()
    
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)            
    
write_byte(TE_PARTICLEBURST
    
engfunc(EngFunc_WriteCoordoriginF[0])
    
engfunc(EngFunc_WriteCoordoriginF[1]) 
    
engfunc(EngFunc_WriteCoordoriginF[2]+10)
    
write_short(250
    
write_byte(70
    
write_byte(55
    
message_end()
    
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)            
    
write_byte(TE_PARTICLEBURST)
    
engfunc(EngFunc_WriteCoordoriginF[0]) 
    
engfunc(EngFunc_WriteCoordoriginF[1]) 
    
engfunc(EngFunc_WriteCoordoriginF[2]+10)
    
write_short(250)
    
write_byte(83
    
write_byte(55)
    
message_end()
    
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
    
write_byte(TE_IMPLOSION)
    
engfunc(EngFunc_WriteCoordoriginF[0]) 
    
engfunc(EngFunc_WriteCoordoriginF[1]) 
    
engfunc(EngFunc_WriteCoordoriginF[2]+10
    
write_byte(random_num(100300))
    
write_byte(20
    
write_byte(3
    
message_end()
}

public 
fw_AWP_PrimaryAttack_Post(awp)
{
    static 
id
    id 
get_pdata_cbase(awpq_pPlayer4)
    if(
used[id] >= get_pcvar_num(cvar_limit)) {
        
client_print(id,print_chat,"Bu Silahi Kullanma Limitiniz Doldu !")
        return 
HAM_IGNORED
    
}
    
used[id]++;
    
    if(
get_pcvar_num(cvar_thunder))
    {
        
        
        if(
is_user_connected(id) && g_lasergun[id])
        {    
            new 
iEndOrigin[3]
            
get_user_origin(idiEndOrigin3)
            
            
message_begin(MSG_BROADCASTSVC_TEMPENTITYiEndOrigin
            
write_byte(TE_EXPLOSION)    
            
write_coord(iEndOrigin[0]) 
            
write_coord(iEndOrigin[1]) 
            
write_coord(iEndOrigin[2] +10
            
write_short(thunder)    
            
write_byte(90)        
            
write_byte(60)        
            
write_byte(TE_EXPLFLAG_NONE)    
            
message_end() 
            
            
message_begin(MSG_BROADCASTSVC_TEMPENTITYiEndOrigin
            
write_byte(TE_EXPLOSION)    
            
write_coord(iEndOrigin[0]) 
            
write_coord(iEndOrigin[1]) 
            
write_coord(iEndOrigin[2]+20
            
write_short(thunder)    
            
write_byte(60)    
            
write_byte(20)        
            
write_byte(TE_EXPLFLAG_NONE)    
            
message_end() 
            
            
message_begin(MSG_BROADCASTSVC_TEMPENTITYiEndOrigin
            
write_byte(TE_EXPLOSION)    
            
write_coord(iEndOrigin[0]) 
            
write_coord(iEndOrigin[1]) 
            
write_coord(iEndOrigin[2] +30
            
write_short(thunder)    
            
write_byte(60)        
            
write_byte(20)            
            
write_byte(TE_EXPLFLAG_NONE)    
            
message_end() 
            
            
message_begin(MSG_BROADCASTSVC_TEMPENTITYiEndOrigin
            
write_byte(TE_BEAMCYLINDER)
            
write_coord(iEndOrigin[0])
            
write_coord(iEndOrigin[1])
            
write_coord(iEndOrigin[2])
            
write_coord(iEndOrigin[0])
            
write_coord(iEndOrigin[1])
            
write_coord(iEndOrigin[2]+200)
            
write_short(hotflarex)
            
write_byte(0)
            
write_byte(1)
            
write_byte(6)
            
write_byte(8)
            
write_byte(1)
            
write_byte(255)
            
write_byte(255)
            
write_byte(192)
            
write_byte(128)
            
write_byte(5)
            
message_end()
            
            
message_beginMSG_ONE_UNRELIABLEShakes_id )
            
write_shortSecond*)
            
write_shortSecond*)
            
write_shortSecond*)
            
message_end( ) 
        }
    }
}

public 
fw_PlayerSpawn_Post(id)
{
if(
get_pcvar_num(cvar_oneround))
{
    if(
g_lasergun[id])
    {
        
g_lasergun[id] = false
        ham_strip_weapon
(id"weapon_awp")
    }
}
}

stock ham_strip_weapon(idweapon[])
{
    if(!
equal(weapon,"weapon_",7)) 
        return 
0
    
    
new idd get_weaponid(weapon)
    
    if(!
idd) 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) == idd
        
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<<idd))
    
    return 
1


Bunu deneyin. Düzelttim sanırım.[/i][/i][/i]


CS:GO ve CS 1.6 için ücretli eklenti yapılır.
Plugin yazmak isteyenlere yardımcı olabilirim.
Skype adresimden ulaşabilirsiniz:
destek_596
Steam: http://steamcommunity.com/id/ca-nemesis/

Reply
#9
evet oldu eğer sorun olmazsa 8 mermili(şarjörsüz) ve mermi bitince silahın kaybolmasını ayarlayabilirmisin.
Çok teşekkür ediyorum ellerine sağlık Smile
Reply
#10
PHP Code:
#include <amxmodx>
#include <zombieplague>
#include <fun>
#include <cstrike>
#include <engine>
#include <hamsandwich>
#include <fakemeta>

/* [ZP] Extra Item : Sniper Laser Gun [SLG] ! By xLeoNNN. (san antonio,chile)
   this is my second plugin, the Sniper Laser Gun [SLG] is a weapon awp with efects,laser,
   Credits : 
   
   meTaLiCroSS  :  for code of damage of "gauss"
   Mr.Death     :  how to create the effects and use the "Temp Entity"
   */
   
new g_ibuy
new cvar_limit,cvar_damage;
new 
used[33];
new 
bullets[33]
new 
hotflarexlaserbthunder
new bool:g_lasergun[33]
new 
g_iMaxPlayers
const q_pPlayer 41
new Shakes
const Second = ( 1<<10 )
new 
cvar_particles_deadcvar_bullet_efectcvar_thundercvar_oneround,cvar_zpammo;
new 
g_currentweapon[33]

new 
V_LASERGUN[] = "models/zombie_plague/v_sniper_laser_gun.mdl" 
new P_LASERGUN[]        = "models/zombie_plague/p_sniper_laser_gun.mdl"
new W_LASERGUN[]    = "models/zombie_plague/w_sniper_laser_gun.mdl"
new const LaserSound[] = "weapons/electro4.wav"

public plugin_init()
{
    
register_plugin("[ZP] Extra Item: Sniper Laser Gun""1.0""x[L]eoNNN"
    
    
Shakes get_user_msgid"ScreenShake" )
    
register_event("CurWeapon""make_tracer""be""1=1""3>0")
    
register_event("CurWeapon""Event_CurWeapon""be","1=1")
    
register_event("HLTV""event_round_start""a""1=0""2=0")
    
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage")
    
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_awp""fw_AWP_PrimaryAttack_Post"1)
    
RegisterHam(Ham_Spawn"player""fw_PlayerSpawn_Post"1)
    
register_forward(FM_SetModel"fw_SetModel")
    
cvar_particles_dead register_cvar("zp_slg_particles""1")
    
cvar_bullet_efect register_cvar("zp_slg_bullet""1")
    
cvar_thunder register_cvar("zp_slg_thunder""1")
    
cvar_oneround register_cvar("zp_slg_oneround""1")
    
cvar_damage register_cvar("zp_slg_damage","1000.0")
    
cvar_limit register_cvar("zp_slg_limit","8")
    
cvar_zpammo register_cvar("zp_slg_ammo","40")
    
    
g_ibuy zp_register_extra_item("Sniper Laser Gun"get_pcvar_num(cvar_zpammo), ZP_TEAM_HUMAN)
    
}

public 
plugin_precache()
{
    
hotflarex precache_model("sprites/flare6.spr")
    
laserb precache_model("sprites/laserbeam.spr")
    
thunder precache_model("sprites/zbeam1.spr")
    
precache_model(V_LASERGUN)
    
precache_model(P_LASERGUN)
    
precache_model(W_LASERGUN)
    
precache_sound(LaserSound)
}

public 
zp_extra_item_selected(iditemid
{
    
    if (
itemid ==g_ibuy)
    {
        
        if(
g_lasergun[id] && user_has_weapon(idCSW_AWP))
        {
            
client_print(idprint_chat"/g[ZP]/y You Already Have Sniper Laser Gun!")
            
zp_set_user_ammo_packs(idzp_get_user_ammo_packs(id) + 40)
        }
        else {
        
            
g_lasergun[id] = true
            give_item 
(id"weapon_awp")
            
cs_set_user_bpammo(idCSW_AWP20)
            
client_print(idprint_center"[ZP] Sniper Laser Gun ON! Killed All Zombies!")
        }
    }
    
    


public 
zp_user_infected_post(infectedinfector)
{
    if (
g_lasergun[infected])
    {
        
g_lasergun[infected] = false
    
}
}

public 
event_round_start()
{
    for (new 
1<= g_iMaxPlayersi++)
    {
        if (!
is_user_connected(i))
            continue
        
        if (
g_lasergun[i])
        {
            
g_lasergun false
        
}
        
used 0;
    }
}

public 
client_putinserver(id)
{
    
used[id] = 0;
    
g_lasergun[id] = false
}

public 
client_disconnect(id)
{
    
g_lasergun[id] = false
}

public 
make_tracer(id)
{
    if(
get_pcvar_num(cvar_bullet_efect))
    {
        if(
g_lasergun[id] && g_currentweapon[id])
        {
            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)) 
            {
                new 
laser1[3], laser2[3]
                
get_user_origin(idlaser11)
                
get_user_origin(idlaser24)
                
                
message_beginMSG_BROADCAST,SVC_TEMPENTITY)
                
write_byte (1)    
                
write_short(id 0x1000
                
write_coord (laser2[0]) 
                
write_coord (laser2[1])
                
write_coord (laser2[2])
                
write_shortlaserb )
                
write_byte(1
                
write_byte(5
                
write_byte(1
                
write_byte(80
                
write_byte(20
                
write_byte(0)    
                
write_byte(52)       
                
write_byte(255)      
                
write_byte(255
                
write_byte(150)
                
message_end()
                
                
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
                
write_byte(TE_DLIGHT
                
write_coord(laser1[0]) 
                
write_coord(laser1[1]) 
                
write_coord(laser1[2]) 
                
write_byte(13
                
write_byte(254)
                
write_byte(0)
                
write_byte(0
                
write_byte(100)
                
write_byte(10)
                
message_end()
                
                
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
                
write_byte(TE_SPRITETRAIL)
                
write_coord(laser1[0]) 
                
write_coord(laser1[1]) 
                
write_coord(laser1[2]) 
                
write_coord(laser1[0]) 
                
write_coord(laser1[1]) 
                
write_coord(laser1[2]) 
                
write_short(hotflarex)
                
write_byte(5)
                
write_byte(1
                
write_byte(3
                
write_byte(34)
                
write_byte(43)
                
message_end()
                
emit_sound(idCHAN_AUTOLaserSoundVOL_NORMATTN_NORM 0PITCH_NORM)
                
            }
            
bullets[id] = clip
        
}
    }
}

public 
Event_CurWeapon(id
{      
    
g_currentweapon[id] = read_data(2)
    
    if(!
g_lasergun[id] || g_currentweapon[id] != CSW_AWP)
        return 
PLUGIN_CONTINUE
    
    entity_set_string
(idEV_SZ_viewmodelV_LASERGUN)
    
entity_set_string(idEV_SZ_weaponmodelP_LASERGUN)
    
    return 
PLUGIN_CONTINUE 
}

public 
fw_SetModel(entitymodel[])
{
    if(!
is_valid_ent(entity))
        return 
FMRES_IGNORED
    
    
    
if(!equali(model"models/w_awp.mdl")) 
        return 
FMRES_IGNORED;
    
    new 
ads entity_get_edict(entityEV_ENT_owner)
    new 
className[33]
    
entity_get_string(entityEV_SZ_classnameclassName32)
    
    if(
equal(className"weaponbox") || equal(className"armoury_entity") || equal(className"grenade"))
    {
        if(
g_lasergun[ads])
        {
            
entity_set_model(entityW_LASERGUN)
            return 
FMRES_SUPERCEDE
        
}
    }
    
    return 
FMRES_IGNORED


public 
fw_TakeDamage(victiminflictorattackerFloat:damagedamage_bits)
{
    if(!
is_user_connected(attacker) || !is_user_connected(victim) || zp_get_user_nemesis(victim) || attacker == victim || !attacker)
        return 
HAM_IGNORED
    
    
if (g_lasergun[attacker] && g_currentweapon[attacker] == CSW_AWP)
    {    
        static 
Float:originF[3]
        
pev(victimpev_originoriginF)
        
        new 
plrWeapIdplrClipplrAmmo
        plrWeapId 
get_user_weapon(attackerplrClipplrAmmo)
        if (
plrWeapId == CSW_AWP)
            
SetHamParamFloat(4damage get_pcvar_float(cvar_damage))
        
        
client_print(attackerprint_center"Enemy Electrocuted!")
        if(
get_pcvar_num(cvar_particles_dead))
            
dead_efect(originF)
    }
    
    if(
zp_get_user_nemesis(victim))
    {
        
client_print(attackerprint_center"Nemesis is Inmune")
    }
    return 
PLUGIN_HANDLED
}

dead_efect(const Float:originF[3])
{    
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)            
    
write_byte(TE_PARTICLEBURST
    
engfunc(EngFunc_WriteCoordoriginF[0])
    
engfunc(EngFunc_WriteCoordoriginF[1]) 
    
engfunc(EngFunc_WriteCoordoriginF[2]+10
    
write_short(250
    
write_byte(70
    
write_byte(55
    
message_end()
    
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)            
    
write_byte(TE_PARTICLEBURST
    
engfunc(EngFunc_WriteCoordoriginF[0])
    
engfunc(EngFunc_WriteCoordoriginF[1]) 
    
engfunc(EngFunc_WriteCoordoriginF[2]+10)
    
write_short(250
    
write_byte(70
    
write_byte(55
    
message_end()
    
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)            
    
write_byte(TE_PARTICLEBURST)
    
engfunc(EngFunc_WriteCoordoriginF[0]) 
    
engfunc(EngFunc_WriteCoordoriginF[1]) 
    
engfunc(EngFunc_WriteCoordoriginF[2]+10)
    
write_short(250)
    
write_byte(83
    
write_byte(55)
    
message_end()
    
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
    
write_byte(TE_IMPLOSION)
    
engfunc(EngFunc_WriteCoordoriginF[0]) 
    
engfunc(EngFunc_WriteCoordoriginF[1]) 
    
engfunc(EngFunc_WriteCoordoriginF[2]+10
    
write_byte(random_num(100300))
    
write_byte(20
    
write_byte(3
    
message_end()
}

public 
fw_AWP_PrimaryAttack_Post(awp)
{
    static 
id
    id 
get_pdata_cbase(awpq_pPlayer4)
    if(
used[id] >= get_pcvar_num(cvar_limit)) {
        
        
client_print(id,print_chat,"Bu Silahi Kullanma Limitiniz Doldu !")
        
g_lasergun[id] = false
        ham_strip_weapon
(id"weapon_awp")
        return 
HAM_IGNORED
    
}
    
used[id]++;
    
    if(
get_pcvar_num(cvar_thunder))
    {
        
        
        if(
is_user_connected(id) && g_lasergun[id])
        {    
            new 
iEndOrigin[3]
            
get_user_origin(idiEndOrigin3)
            
            
message_begin(MSG_BROADCASTSVC_TEMPENTITYiEndOrigin
            
write_byte(TE_EXPLOSION)    
            
write_coord(iEndOrigin[0]) 
            
write_coord(iEndOrigin[1]) 
            
write_coord(iEndOrigin[2] +10
            
write_short(thunder)    
            
write_byte(90)        
            
write_byte(60)        
            
write_byte(TE_EXPLFLAG_NONE)    
            
message_end() 
            
            
message_begin(MSG_BROADCASTSVC_TEMPENTITYiEndOrigin
            
write_byte(TE_EXPLOSION)    
            
write_coord(iEndOrigin[0]) 
            
write_coord(iEndOrigin[1]) 
            
write_coord(iEndOrigin[2]+20
            
write_short(thunder)    
            
write_byte(60)    
            
write_byte(20)        
            
write_byte(TE_EXPLFLAG_NONE)    
            
message_end() 
            
            
message_begin(MSG_BROADCASTSVC_TEMPENTITYiEndOrigin
            
write_byte(TE_EXPLOSION)    
            
write_coord(iEndOrigin[0]) 
            
write_coord(iEndOrigin[1]) 
            
write_coord(iEndOrigin[2] +30
            
write_short(thunder)    
            
write_byte(60)        
            
write_byte(20)            
            
write_byte(TE_EXPLFLAG_NONE)    
            
message_end() 
            
            
message_begin(MSG_BROADCASTSVC_TEMPENTITYiEndOrigin
            
write_byte(TE_BEAMCYLINDER)
            
write_coord(iEndOrigin[0])
            
write_coord(iEndOrigin[1])
            
write_coord(iEndOrigin[2])
            
write_coord(iEndOrigin[0])
            
write_coord(iEndOrigin[1])
            
write_coord(iEndOrigin[2]+200)
            
write_short(hotflarex)
            
write_byte(0)
            
write_byte(1)
            
write_byte(6)
            
write_byte(8)
            
write_byte(1)
            
write_byte(255)
            
write_byte(255)
            
write_byte(192)
            
write_byte(128)
            
write_byte(5)
            
message_end()
            
            
message_beginMSG_ONE_UNRELIABLEShakes_id )
            
write_shortSecond*)
            
write_shortSecond*)
            
write_shortSecond*)
            
message_end( ) 
        }
    }
}

public 
fw_PlayerSpawn_Post(id)
{
    if(
get_pcvar_num(cvar_oneround))
    {
        if(
g_lasergun[id])
        {
            
g_lasergun[id] = false
            ham_strip_weapon
(id"weapon_awp")
        }
    }
}

stock ham_strip_weapon(idweapon[])
{
    if(!
equal(weapon,"weapon_",7)) 
        return 
0
    
    
new idd get_weaponid(weapon)
    
    if(!
idd) 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) == idd
        
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<<idd))
    
    return 
1


Cvarlar:
zp_slg_limit "8" // Maksimum kullanılabilecek kurşun sayısı.
zp_slg_ammo "40" // Silahın fiyatı
zp_slg_damage "1000.0" // Zarar katsayısı

Kursun bittiğinde silahın yok olması eklendi.[/i][/i][/i]


CS:GO ve CS 1.6 için ücretli eklenti yapılır.
Plugin yazmak isteyenlere yardımcı olabilirim.
Skype adresimden ulaşabilirsiniz:
destek_596
Steam: http://steamcommunity.com/id/ca-nemesis/

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [ZP] Laser Plugini Sorunu buyukkaptan90 12 8,249 20-03-13, 15:30
Last Post: buyukkaptan90
  Amxmodu Kurunca Sniper Zoomunu yavaş açıyor yardım kafkef12 9 4,807 19-05-12, 12:44
Last Post: kanka3838

Foruma Atla:


Users browsing this thread: