Konu

#1
selamun aleykuum beyler bu zombi classını admine özel yapmak istiyorum yapınca nasıl yaptıgınız anlatırsanız sevinirim öğrenmek istiyorum

güncel

güncell
.sma zp_sting_finger.sma (Dosya Boyutu: 13,04 KB | İndirme Sayısı: 6)
Son Düzenleme: 24-10-2021, 21:09, Düzenleyen: qwqwqw.
#2
Konuyu açar açmaz 2 kere güncellemişsiniz. Biraz sakin olun.

Hangi yetkiye özel ayarlanmasını istiyorsunuz ?
@qwqwqw
(- Ücretli Eklenti Yaptırmak İsteyen -)
#3
ADMIN_IMMUNITY
#4
Deneyin bakalım :
PHP Kod:
#include <amxmodx>
#include <zombieplague>
#include <fakemeta>
#include <engine>
#include <hamsandwich>
#include <cstrike>
#include <xs>

// Task offsets
enum (+= 100) {
    
TASK_BURN
}

// IDs inside tasks
#define ID_BURN (taskid - TASK_BURN)

#define is_user_valid_alive(%1) (1 <= %1 <= g_maxplayers && is_user_alive(%1))

new const zclass_name[] = { "Toksic Zombi (Alev Topu)" 
new const 
zclass_info[] = { "[Yetenek Icin 'R'](Admin)" 
new const 
zclass_model[] = { "tm_zm_toxic" 
new const 
zclass_clawmodel[] = { "v_knife_toxic.mdl" }
const 
zclass_health 10000
const zclass_speed 300
const Float:zclass_gravity 0.69
const Float:zclass_knockback 3.0 

new g_Husk
new g_trailSpr
new const fire_model[] = "sprites/3dmflared.spr"

// Cooldown hook
new Float:g_iLastFire[33]

new 
cvar_firespeedcvar_firecooldowncvar_firedamagecvar_firedurationcvar_fireslowdowncvar_fireradiuscvar_firesurvivor
new g_smokeSprg_flameSprg_exploSpr
new g_burning_duration[33// burning task duration
new g_maxplayers
new attacker

new g_msgSayText

public plugin_init()
{
    
register_plugin("[ZP] Zombie Class: Zombie Husk""0.2""DJHD!"
    
    
cvar_firespeed register_cvar("zp_husk_fire_speed""700")
    
cvar_firecooldown register_cvar("ze_husk_fire_cooldown""20.0")
    
cvar_firedamage register_cvar("zp_husk_fire_damage""2.5")
    
cvar_fireduration register_cvar("zp_husk_fire_duration""2.5")
    
cvar_fireslowdown register_cvar("zp_husk_fire_slowdown""0.5")
    
cvar_fireradius register_cvar("zp_husk_fire_radius""220.0")
    
cvar_firesurvivor register_cvar("zp_husk_fire_survivor""1")
    
    
register_forward(FM_Touch"fw_Touch")
    
register_forward(FM_PlayerPreThink"fw_PlayerPreThink")
    
    
// HAM Forwards
    
RegisterHam(Ham_Spawn"player""fw_PlayerSpawn_Post"1)
    
RegisterHam(Ham_Killed"player""fw_PlayerKilled")
    
    
g_maxplayers get_maxplayers()
    
g_msgSayText get_user_msgid("SayText")


public 
plugin_precache()
{
    
g_Husk zp_register_zombie_class(zclass_namezclass_infozclass_modelzclass_clawmodelzclass_healthzclass_speedzclass_gravityzclass_knockback
    
    
engfunc(EngFunc_PrecacheModelfire_model)
    
    
g_trailSpr engfunc(EngFunc_PrecacheModel"sprites/laserbeam.spr")
    
g_smokeSpr engfunc(EngFunc_PrecacheModel"sprites/black_smoke3.spr")
    
g_flameSpr engfunc(EngFunc_PrecacheModel"sprites/flame.spr")
    
g_exploSpr engfunc(EngFunc_PrecacheModel"sprites/zerogxplode.spr")
    
    
engfunc(EngFunc_PrecacheSound"zombie_plague/husk_pre_fire.wav")
    
engfunc(EngFunc_PrecacheSound"zombie_plague/husk_wind_down.wav")
    
engfunc(EngFunc_PrecacheSound"zombie_plague/husk_fireball_fire.wav")
    
engfunc(EngFunc_PrecacheSound"zombie_plague/husk_fireball_loop.wav")
    
engfunc(EngFunc_PrecacheSound"zombie_plague/husk_fireball_explode.wav")
}

public 
zp_user_infected_post(idinfector)
{
    if(~
get_user_flags(id) & ADMIN_IMMUNITY){
        
zp_colored_print(id"^x04[ZE]^x01 Bu classi kullanabilmeniz icin yetkiniz yetersiz.")
        return;
    }
    if (
zp_get_user_zombie_class(id) == g_Husk)
    {
        if(
zp_get_user_nemesis(id))
            return
        
        
g_iLastFire[id] = 0.0
        
        zp_colored_print
(id"^x04[ZE]^x01 Sinifinin yetenegi Zehir Firlatma. Yuklenme suresi %.1f saniye."get_cvar_num("ze_husk_fire_cooldown"))
    }
}

public 
fw_PlayerPreThink(id)
{
    if(!
is_user_alive(id))
        return;
    
    static 
iButtoniButton pev(idpev_button)
    static 
iOldButtoniOldButton pev(idpev_oldbuttons)
    
    if(
zp_get_user_zombie(id) && (zp_get_user_zombie_class(id) == g_Husk) && !zp_get_user_nemesis(id))
    {
        if((
iButton IN_RELOAD) && !(iOldButton IN_RELOAD))
        {            
            if(
get_gametime() - g_iLastFire[id] < get_pcvar_float(cvar_firecooldown))
            {
                return;
            }
            
            
g_iLastFire[id] = get_gametime()
            
            
message_begin(MSG_ONEget_user_msgid("BarTime"), _id)
            
write_byte(1)
            
write_byte(0)
            
message_end()
            
            
emit_sound(idCHAN_ITEM"zombie_plague/husk_pre_fire.wav"1.0ATTN_NORM0PITCH_NORM)
            
            
set_task(1.0"MakeFire"id)
        }
        
        if(
iOldButton IN_RELOAD && !(iButton IN_RELOAD))
        {
            if(
task_exists(id))
            {
                
g_iLastFire[id] = 0.0
                emit_sound
(idCHAN_ITEM"zombie_plague/husk_wind_down.wav"1.0ATTN_NORM0PITCH_NORM)
            }
            
            
message_begin(MSG_ONEget_user_msgid("BarTime"), _id)
            
write_byte(0)
            
write_byte(0)
            
message_end()
            
            
remove_task(id)
        }
    }
}

// Ham Player Spawn Post Forward
public fw_PlayerSpawn_Post(id)
{
    
// Not alive or didn't join a team yet
    
if (!is_user_alive(id) || !cs_get_user_team(id))
        return;
    
    
// Remove previous tasks
    
remove_task(id+TASK_BURN)
}

// Ham Player Killed Forward
public fw_PlayerKilled(victimattackershouldgib)
{    
    
// Stop burning
    
if (!zp_get_user_zombie(victim))
        
remove_task(victim+TASK_BURN)
}

public 
client_disconnected(id)
    
remove_task(id+TASK_BURN)

public 
MakeFire(id)
{
    new 
Float:Origin[3]
    new 
Float:vAngle[3]
    new 
Float:flVelocity[3]
    
    
// Get position from eyes
    
get_user_eye_position(idOrigin)
    
    
// Get View Angles
    
entity_get_vector(idEV_VEC_v_anglevAngle)
    
    new 
NewEnt create_entity("info_target")
    
    
entity_set_string(NewEntEV_SZ_classname"fireball")
    
    
entity_set_model(NewEntfire_model)
    
    
entity_set_size(NewEntFloat:{ -1.5, -1.5, -1.5 }, Float:{ 1.51.51.5 })
    
    
entity_set_origin(NewEntOrigin)
    
    
// Set Entity Angles (thanks to Arkshine)
    
make_vector(vAngle)
    
entity_set_vector(NewEntEV_VEC_anglesvAngle)
    
    
entity_set_int(NewEntEV_INT_solidSOLID_BBOX)
    
    
entity_set_float(NewEntEV_FL_scale0.3)
    
entity_set_int(NewEntEV_INT_spawnflagsSF_SPRITE_STARTON)
    
entity_set_float(NewEntEV_FL_framerate25.0)
    
set_rendering(NewEntkRenderFxNone000kRenderTransAdd255)
    
    
entity_set_int(NewEntEV_INT_movetypeMOVETYPE_FLY)
    
entity_set_edict(NewEntEV_ENT_ownerid)
    
    
// Set Entity Velocity
    
velocity_by_aim(idget_pcvar_num(cvar_firespeed), flVelocity)
    
entity_set_vector(NewEntEV_VEC_velocityflVelocity)
    
    
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
    
write_byte(TE_BEAMFOLLOW// TE id
    
write_short(NewEnt// entity
    
write_short(g_trailSpr// sprite
    
write_byte(5// life
    
write_byte(6// width
    
write_byte(255// r
    
write_byte(0// g
    
write_byte(0// b
    
write_byte(255// brightness
    
message_end()
    
    
set_task(0.2"effect_fire"NewEnt__"b"
    
    
emit_sound(idCHAN_ITEM"zombie_plague/husk_fireball_fire.wav"VOL_NORMATTN_NORM0PITCH_NORM)
    
emit_sound(NewEntCHAN_ITEM"zombie_plague/husk_fireball_loop.wav"VOL_NORMATTN_NORM0PITCH_NORM)
}

public 
effect_fire(entity)
{
    if (!
pev_valid(entity))
    {
        
remove_task(entity)
        return;
    }
    
    
// Get origin
    
static Float:originF[3]
    
pev(entitypev_originoriginF)
    
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
    
write_byte(17)
    
engfunc(EngFunc_WriteCoordoriginF[0])         // x
    
engfunc(EngFunc_WriteCoordoriginF[1])         // y
    
engfunc(EngFunc_WriteCoordoriginF[2]+30)         // z
    
write_short(g_flameSpr)
    
write_byte(5)                         // byte (scale in 0.1's) 188 - era 65
    
write_byte(200)                     // byte (framerate)
    
message_end()
    
    
// Smoke
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
    
write_byte(5)
    
engfunc(EngFunc_WriteCoordoriginF[0])     // x
    
engfunc(EngFunc_WriteCoordoriginF[1])     // y
    
engfunc(EngFunc_WriteCoordoriginF[2])     // z
    
write_short(g_smokeSpr)                // short (sprite index)
    
write_byte(13)                     // byte (scale in 0.1's)
    
write_byte(15)                     // byte (framerate)
    
message_end()    
    
    
// Colored Aura
    
engfunc(EngFunc_MessageBeginMSG_PASSVC_TEMPENTITYoriginF0)
    
write_byte(TE_DLIGHT)             // TE id
    
engfunc(EngFunc_WriteCoordoriginF[0])    // x
    
engfunc(EngFunc_WriteCoordoriginF[0])    // y
    
engfunc(EngFunc_WriteCoordoriginF[0])    // z
    
write_byte(25)                 // radius
    
write_byte(255)             // r
    
write_byte(128)             // g
    
write_byte(0)                 // b
    
write_byte(2)                 // life
    
write_byte(3)                 // decay rate
    
message_end()
}

// Touch Forward
public fw_Touch(entid)
{
    if (!
pev_valid(ent)) 
        return 
PLUGIN_HANDLED
    
    
new class[32]
    
pev(entpev_classname, class, charsmax(class))
    
    if(
equal(class, "fireball"))
    {
        
attacker entity_get_edict(entEV_ENT_owner)
        
husk_touch(ent)
        
engfunc(EngFunc_RemoveEntityent)
        return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_HANDLED
}

public 
husk_touch(ent)
{
    if (!
pev_valid(ent)) 
        return;
    
    
// Get origin
    
static Float:originF[3]
    
pev(entpev_originoriginF)
    
    
// Explosion
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
    
write_byte(TE_EXPLOSION)
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y
    
engfunc(EngFunc_WriteCoordoriginF[2]) // z
    
write_short(g_exploSpr)
    
write_byte(40)         // byte (scale in 0.1's) 188 - era 65
    
write_byte(25)         // byte (framerate)
    
write_byte(TE_EXPLFLAG_NOSOUND// byte flags
    
message_end()
    
    
emit_sound(entCHAN_ITEM"zombie_plague/husk_fireball_explode.wav"VOL_NORMATTN_NORM0PITCH_NORM)
    
    
// Collisions
    
static victim
    victim 
= -1
    
    
while ((victim engfunc(EngFunc_FindEntityInSpherevictimoriginFget_pcvar_float(cvar_fireradius))) != 0)
    {
        
// Only effect alive zombies
        
if (!is_user_valid_alive(victim) || zp_get_user_zombie(victim) || !get_pcvar_num(cvar_firesurvivor) && zp_get_user_survivor(victim))
            continue;
        
        
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("Damage"), _victim)
        
write_byte(0// damage save
        
write_byte(0// damage take
        
write_long(DMG_BURN// damage type
        
write_coord(0// x
        
write_coord(0// y
        
write_coord(0// z
        
message_end()
        
        
g_burning_duration[victim] += get_pcvar_num(cvar_fireduration) * 5
        
        
// Set burning task on victim if not present
        
if (!task_exists(victim+TASK_BURN))
            
set_task(0.2"burning_flame"victim+TASK_BURN__"b")
    }
}

// Burning Flames
public burning_flame(taskid)
{
    
// Get player origin and flags
    
static origin[3], flags
    get_user_origin
(ID_BURNorigin)
    
flags pev(ID_BURNpev_flags)
    
    
// in water - burning stopped
    
if (zp_get_user_zombie(ID_BURN) || (flags FL_INWATER) || g_burning_duration[ID_BURN] < 1)
    {
        
// Smoke sprite
        
message_begin(MSG_PVSSVC_TEMPENTITYorigin)
        
write_byte(TE_SMOKE// TE id
        
write_coord(origin[0]) // x
        
write_coord(origin[1]) // y
        
write_coord(origin[2]-50// z
        
write_short(g_smokeSpr// sprite
        
write_byte(random_num(1520)) // scale
        
write_byte(random_num(1020)) // framerate
        
message_end()
        
        
// Task not needed anymore
        
remove_task(taskid);
        return;
    }
    
    if ((
pev(ID_BURNpev_flags) & FL_ONGROUND) && get_pcvar_float(cvar_fireslowdown) > 0.0)
    {
        static 
Float:velocity[3]
        
pev(ID_BURNpev_velocityvelocity)
        
xs_vec_mul_scalar(velocityget_pcvar_float(cvar_fireslowdown), velocity)
        
set_pev(ID_BURNpev_velocityvelocity)
    }
    
    
// Get player's health
    
static health
    health 
pev(ID_BURNpev_health)
    
    if (
health get_pcvar_float(cvar_firedamage))
        
fm_set_user_health(ID_BURNhealth floatround(get_pcvar_float(cvar_firedamage)))
    else
        
zp_infect_user(ID_BURNattacker01)
    
    
// Flame sprite
    
message_begin(MSG_PVSSVC_TEMPENTITYorigin)
    
write_byte(TE_SPRITE// TE id
    
write_coord(origin[0]+random_num(-55)) // x
    
write_coord(origin[1]+random_num(-55)) // y
    
write_coord(origin[2]+random_num(-1010)) // z
    
write_short(g_flameSpr// sprite
    
write_byte(random_num(510)) // scale
    
write_byte(200// brightness
    
message_end()
    
    
// Decrease burning duration counter
    
g_burning_duration[ID_BURN]--
}

/*================================================================================
[Stocks]
=================================================================================*/

stock get_user_eye_position(idFloat:flOrigin[3])
{
    static 
Float:flViewOffs[3]
    
entity_get_vector(idEV_VEC_view_ofsflViewOffs)
    
entity_get_vector(idEV_VEC_originflOrigin)
    
xs_vec_add(flOriginflViewOffsflOrigin)
}

stock make_vector(Float:flVec[3])
{
    
flVec[0] -= 30.0
    engfunc
(EngFunc_MakeVectorsflVec)
    
flVec[0] = -(flVec[0] + 30.0)
}

// Set player's health (from fakemeta_util)
stock fm_set_user_health(idhealth)
{
    (
health 0) ? set_pev(idpev_healthfloat(health)) : dllfunc(DLLFunc_ClientKillid);
}

zp_colored_print(target, const message[], any:...)
{
    static 
buffer[512], iargscount
    argscount 
numargs()
    
    if (!
target)
    {
        static 
player
        
for (player 1player <= g_maxplayersplayer++)
        {
            if (!
is_user_connected(player))
                continue;
            
            static 
changed[5], changedcount
            changedcount 
0
            
            
for (2argscounti++)
            {
                if (
getarg(i) == LANG_PLAYER)
                {
                    
setarg(i0player)
                    
changed[changedcount] = i
                    changedcount
++
                }
            }
            
            
vformat(buffercharsmax(buffer), message3)
            
            
message_begin(MSG_ONE_UNRELIABLEg_msgSayText_player)
            
write_byte(player)
            
write_string(buffer)
            
message_end()
            
            for (
0changedcounti++)
                
setarg(changed[i], 0LANG_PLAYER)
        }
    }
    else
    {
        
vformat(buffercharsmax(buffer), message3)
        
        
message_begin(MSG_ONEg_msgSayText_target)
        
write_byte(target)
        
write_string(buffer)
        
message_end()
    }

(- Ücretli Eklenti Yaptırmak İsteyen -)
#5
@suriyelikene malesef olmamış
#6
@qwqwqw Eklentide bir hata göremiyorum. Eski classı sildiğinize emin misiniz ?
(- Ücretli Eklenti Yaptırmak İsteyen -)
#7
@suriyelikene eklentiyi panele ilk defa kurdum daha önce kurmamıştım user olarak girdim alınıyor zombi içerisine yazdığınız say komutuda yazmıyor yetkiniz yetersiz vs

Güncel
Son Düzenleme: 25-10-2021, 21:49, Düzenleyen: qwqwqw.
#8
İstek konusu, @suriyelikene adlı kullanıcı tarafından 1 gün içinde çözülmüştür.
İsteği çözdüğü için suriyelikene Adlı kullanıcıya 1 rep puanı ve 1 yardım etme puanı otomatik olarak verilmiştir.
suriyelikene Adlı kullanıcı sizin dışınızda toplam 691 kişiye yardım etmiştir.

Herhangi bir konuda hata olduğunu düşünüyorsanız destek sistemi üzerinden iletişim kurabilirsiniz.

Bir hesap oluşturun veya yorum yapmak için giriş yapın

Yorum yapmak için üye olmanız gerekiyor

ya da

Benzer Konular

Task
Kayıt Ol
Discord Adresimize Katılın