找回密碼
 註冊
[日本手機遊戲APPS下載] 手機遊戲專區 熱門短片

型男索女 
樓主: wilson409

[手把手]教你DIY AMXX PLUGIN :D

[複製鏈接]
頭像被屏蔽
發表於 8-2-2009 20:39:38 | 顯示全部樓層
提示: 作者被禁止或刪除 內容自動屏蔽
回復 支持 反對

使用道具 舉報

頭像被屏蔽
發表於 8-2-2009 20:43:21 | 顯示全部樓層
提示: 作者被禁止或刪除 內容自動屏蔽
回復 支持 反對

使用道具 舉報

發表於 8-2-2009 20:54:23 | 顯示全部樓層
本帖最後由 TestingServer 於 8-2-2009 21:06 編輯
錦你就死la
Willy.B 發表於 8-2-2009 19:30

ha
我衰左 la

zp_infect_user(id, origin[id])


what's that ?????
what's the code for ?
回復 支持 反對

使用道具 舉報

發表於 8-2-2009 21:10:44 | 顯示全部樓層
ZPM

喪屍來- -

zombieplague.inc

5.11 KB, 下載次數: 30

回復 支持 反對

使用道具 舉報

頭像被屏蔽
發表於 8-2-2009 21:13:39 | 顯示全部樓層
提示: 作者被禁止或刪除 內容自動屏蔽
回復 支持 反對

使用道具 舉報

發表於 8-2-2009 21:16:14 | 顯示全部樓層
ZPM

喪屍來- -
yathsing 發表於 8-2-2009 21:10

不如殺左個CT 再
zp_respawn_user(id, team)

唔好用zp_infect_user(id, infector = 0)
回復 支持 反對

使用道具 舉報

頭像被屏蔽
發表於 8-2-2009 21:18:45 | 顯示全部樓層
提示: 作者被禁止或刪除 內容自動屏蔽
回復 支持 反對

使用道具 舉報

發表於 8-2-2009 21:19:59 | 顯示全部樓層
唔識整插件揮手區!#bye#
唔好kick我 發表於 8-2-2009 21:13

X3 我都唔識
回復 支持 反對

使用道具 舉報

發表於 8-2-2009 21:20:16 | 顯示全部樓層
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <fakemeta_cstrike>
#include <hamsandwich>
#include <zombieplague>

const Float:EXPLOSION_RADIUS = 240.0

// Stupid compiler
#pragma unused g_models_i

new Float:g_models_i // delay between Model Change messages

new g_zclass_boom, g_exploSpr, g_msgDeathMsg, g_msgScoreInfo, g_msgScoreAttrib

new const sound_armorhit[] = "player/bhit_helmet-1.wav"
new const grenade_infect_player[][] = { "scientist/scream20.wav", "scientist/scream22.wav", "scientist/scream05.wav" }
new const sprite_grenade_ring[] = { "sprites/shockwave.spr" }


new const zclass_name[] = { "-Boomer-" }
new const zclass_info[] = { "會被擊退" }
new const zclass_model[] = { "3fung_ser2" }
new const zclass_clawmodel[] = {"v_fungser.mdl" }
const zclass_health = 550
const zclass_speed = 280
const Float:zclass_gravity = 1.0
const Float:zclass_knockback = 8.0

public plugin_init()
{
        register_plugin("[ZP] Boomer","1.0","Awp King + oN.")
        register_event("DeathMsg","death","a")
        g_msgScoreInfo = get_user_msgid("ScoreInfo")
        g_msgDeathMsg = get_user_msgid("DeathMsg")
        g_msgScoreAttrib = get_user_msgid("ScoreAttrib")
        register_clcmd("zb_boom", "pushboom")
        g_zclass_boom = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel,  zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
}
public plugin_precache()
{
        new i
        engfunc(EngFunc_PrecacheSound, sound_armorhit)
        for (i = 0; i < sizeof grenade_infect_player; i++)
                engfunc(EngFunc_PrecacheSound, grenade_infect_player[i])

        g_exploSpr = engfunc(EngFunc_PrecacheModel, sprite_grenade_ring)

}
public death(id)
{
      new victim = read_data(2)
      new id = victim
      if(zp_get_user_zombie_class(id) == g_zclass_boom && zp_get_user_zombie(id))
      {
             BlowUp(id)
      }
}
public pushboom(id)
{
      if(zp_get_user_zombie_class(id) == g_zclass_boom && zp_get_user_zombie(id))
      {
             BlowUp(id)
             user_kill(id, 0)
      }
}
public BlowUp(id)
{       
        // Get origin
        static FloatriginF[3]
        pev(id, pev_origin, originF)
       
        // Make the explosion
        create_blast(originF)
       
        // Infection nade explode sound
        //engfunc(EngFunc_EmitSound, id, CHAN_WEAPON, grenade_infect[random_num(0, sizeof grenade_infect - 1)], 1.0, ATTN_NORM, 0, PITCH_NORM)
       
        // Get attacker
        static attacker
        attacker = pev(id, pev_owner)
       
        g_models_i = 0.0 // reset model change counter
       
        // Collisions
        static victim
        victim = -1
       
        while ((victim = engfunc(EngFunc_FindEntityInSphere, victim, originF, EXPLOSION_RADIUS)) != 0)
        {
                // Only effect alive non-spawnprotected humans
                if (!is_user_alive(victim) || zp_get_user_zombie(victim))
                        continue;

                static Float:armor
                pev(victim, pev_armorvalue, armor)
                // Human has armor?
                if (armor > 99)
                {
                        set_pev(victim, pev_armorvalue, floatmax(0.0, armor - 100))
                        engfunc(EngFunc_EmitSound, victim, CHAN_BODY, sound_armorhit, 1.0, ATTN_NORM, 0, PITCH_NORM)
                        continue;
                }
               
                // Last human is killed
                if (zp_get_user_last_human(victim))
                {
                        ExecuteHamB(Ham_Killed, victim, attacker, 0)
                        continue;
                }
               
                // Infected victim's sound
                engfunc(EngFunc_EmitSound, victim, CHAN_VOICE, grenade_infect_player[random_num(0, sizeof grenade_infect_player - 1)], 1.0, ATTN_NORM, 0, PITCH_NORM)
               
                SendDeathMsg(attacker, victim) // send death notice
                FixDeadAttrib(victim) // fix the "dead" attrib on scoreboard
                UpdateFrags(attacker, victim, 1, 1, 1) // add corresponding frags & deaths               
               
                zp_infect_user(victim)
                zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) + 1)
        }
       
        // Get rid of the grenade
        engfunc(EngFunc_RemoveEntity, id)

}
// Infection Grenade: Green Blast
create_blast(const FloatriginF[3])
{
        // Smallest ring
        engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, originF, 0)
        write_byte(TE_BEAMCYLINDER) // TE id
        engfunc(EngFunc_WriteCoord, originF[0]) // x
        engfunc(EngFunc_WriteCoord, originF[1]) // y
        engfunc(EngFunc_WriteCoord, originF[2]) // z
        engfunc(EngFunc_WriteCoord, originF[0]) // x axis
        engfunc(EngFunc_WriteCoord, originF[1]) // y axis
        engfunc(EngFunc_WriteCoord, originF[2]+385.0) // z axis
        write_short(g_exploSpr) // sprite
        write_byte(0) // startframe
        write_byte(0) // framerate
        write_byte(4) // life
        write_byte(60) // width
        write_byte(0) // noise
        write_byte(0) // red
        write_byte(200) // green
        write_byte(0) // blue
        write_byte(200) // brightness
        write_byte(0) // speed
        message_end()
       
        // Medium ring
        engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, originF, 0)
        write_byte(TE_BEAMCYLINDER) // TE id
        engfunc(EngFunc_WriteCoord, originF[0]) // x
        engfunc(EngFunc_WriteCoord, originF[1]) // y
        engfunc(EngFunc_WriteCoord, originF[2]) // z
        engfunc(EngFunc_WriteCoord, originF[0]) // x axis
        engfunc(EngFunc_WriteCoord, originF[1]) // y axis
        engfunc(EngFunc_WriteCoord, originF[2]+470.0) // z axis
        write_short(g_exploSpr) // sprite
        write_byte(0) // startframe
        write_byte(0) // framerate
        write_byte(4) // life
        write_byte(60) // width
        write_byte(0) // noise
        write_byte(0) // red
        write_byte(200) // green
        write_byte(0) // blue
        write_byte(200) // brightness
        write_byte(0) // speed
        message_end()
       
        // Largest ring
        engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, originF, 0)
        write_byte(TE_BEAMCYLINDER) // TE id
        engfunc(EngFunc_WriteCoord, originF[0]) // x
        engfunc(EngFunc_WriteCoord, originF[1]) // y
        engfunc(EngFunc_WriteCoord, originF[2]) // z
        engfunc(EngFunc_WriteCoord, originF[0]) // x axis
        engfunc(EngFunc_WriteCoord, originF[1]) // y axis
        engfunc(EngFunc_WriteCoord, originF[2]+555.0) // z axis
        write_short(g_exploSpr) // sprite
        write_byte(0) // startframe
        write_byte(0) // framerate
        write_byte(4) // life
        write_byte(60) // width
        write_byte(0) // noise
        write_byte(0) // red
        write_byte(200) // green
        write_byte(0) // blue
        write_byte(200) // brightness
        write_byte(0) // speed
        message_end()
}
// Fix Dead Attrib on scoreboard
FixDeadAttrib(id)
{
        message_begin(MSG_BROADCAST, g_msgScoreAttrib)
        write_byte(id) // id
        write_byte(0) // attrib
        message_end()
}

// Send Death Message for infections
SendDeathMsg(attacker, victim)
{
        message_begin(MSG_BROADCAST, g_msgDeathMsg)
        write_byte(attacker) // killer
        write_byte(victim) // victim
        write_byte(1) // headshot flag
        write_string("infection") // killer's weapon
        message_end()
}

// Update Player Frags and Deaths
UpdateFrags(attacker, victim, frags, deaths, scoreboard)
{
        // Set attacker frags
        set_pev(attacker, pev_frags, float(pev(attacker, pev_frags) + frags))
       
        // Set victim deaths
        fm_set_user_deaths(victim, fm_get_user_deaths(victim) + deaths)
       
        // Update scoreboard with attacker and victim info
        if (scoreboard)
        {
                message_begin(MSG_BROADCAST, g_msgScoreInfo)
                write_byte(attacker) // id
                write_short(pev(attacker, pev_frags)) // frags
                write_short(fm_get_user_deaths(attacker)) // deaths
                write_short(0) // class?
                write_short(fm_get_user_team(attacker)) // team
                message_end()
               
                message_begin(MSG_BROADCAST, g_msgScoreInfo)
                write_byte(victim) // id
                write_short(pev(victim, pev_frags)) // frags
                write_short(fm_get_user_deaths(victim)) // deaths
                write_short(0) // class?
                write_short(fm_get_user_team(victim)) // team
                message_end()
        }
}

點搞好?
回復 支持 反對

使用道具 舉報

發表於 8-2-2009 21:28:59 | 顯示全部樓層
本帖最後由 TestingServer 於 8-2-2009 21:36 編輯

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <fakemeta_cstrike>
#include <hamsandwich>
#include <zombieplague>

const Float:EXPLOSION_RADIUS = 240.0

// Stupid compiler
#pragma unused g_models_i

new Float:g_models_i // delay between Model Change messages

new g_zclass_boom, g_exploSpr, g_msgDeathMsg, g_msgScoreInfo, g_msgScoreAttrib

new const sound_armorhit[] = "player/bhit_helmet-1.wav"
new const grenade_infect_player[][] = { "scientist/scream20.wav", "scientist/scream22.wav", "scientist/scream05.wav" }
new const sprite_grenade_ring[] = { "sprites/shockwave.spr" }


new const zclass_name[] = { "-Boomer-" }
new const zclass_info[] = { "會被擊退" }
new const zclass_model[] = { "3fung_ser2" }
new const zclass_clawmodel[] = {"v_fungser.mdl" }
const zclass_health = 550
const zclass_speed = 280
const Float:zclass_gravity = 1.0
const Float:zclass_knockback = 8.0

public plugin_init()
{
        register_plugin("[ZP] Boomer","1.0","Awp King + oN.")
        register_event("DeathMsg","death","a")
        g_msgScoreInfo = get_user_msgid("ScoreInfo")
        g_msgDeathMsg = get_user_msgid("DeathMsg")
        g_msgScoreAttrib = get_user_msgid("ScoreAttrib")
        register_clcmd("zb_boom", "pushboom")
        g_zclass_boom = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel,  zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
}
public plugin_precache()
{
        new i
        engfunc(EngFunc_PrecacheSound, sound_armorhit)
        for (i = 0; i < sizeof grenade_infect_player; i++)
                engfunc(EngFunc_PrecacheSound, grenade_infect_player)

        g_exploSpr = engfunc(EngFunc_PrecacheModel, sprite_grenade_ring)

}
public death(id)
{
      new victim = read_data(2)
      new id = victim
      if(zp_get_user_zombie_class(id) == g_zclass_boom && zp_get_user_zombie(id))
      {
             BlowUp(id)
      }
}
public pushboom(id)
{
      if(zp_get_user_zombie_class(id) == g_zclass_boom && zp_get_user_zombie(id))
      {
             BlowUp(id)
             user_kill(id, 0)
      }
}
public BlowUp(id)
{        
        // Get origin
        static FloatriginF[3]
        pev(id, pev_origin, originF)
        
        // Make the explosion
        create_blast(originF)
        
        // Infection nade explode sound
        //engfunc(EngFunc_EmitSound, id, CHAN_WEAPON, grenade_infect[random_num(0, sizeof grenade_infect - 1)], 1.0, ATTN_NORM, 0, PITCH_NORM)
        
        // Get attacker
        static attacker
        attacker = pev(id, pev_owner)
        
        g_models_i = 0.0 // reset model change counter
        
        // Collisions
        static victim
        victim = -1
        
        while ((victim = engfunc(EngFunc_FindEntityInSphere, victim, originF, EXPLOSION_RADIUS)) != 0)
        {
                // Only effect alive non-spawnprotected humans
                if (!is_user_alive(victim) || zp_get_user_zombie(victim))
                        continue;

                static Float:armor
                pev(victim, pev_armorvalue, armor)
                // Human has armor?
                if (armor > 99)
                {
                        set_pev(victim, pev_armorvalue, floatmax(0.0, armor - 100))
                        engfunc(EngFunc_EmitSound, victim, CHAN_BODY, sound_armorhit, 1.0, ATTN_NORM, 0, PITCH_NORM)
                        continue;
                }
               
                // Last human is killed
                if (zp_get_user_last_human(victim))
                {
                        ExecuteHamB(Ham_Killed, victim, attacker, 0)
                        continue;
                }
               
                // Infected victim's sound
                engfunc(EngFunc_EmitSound, victim, CHAN_VOICE, grenade_infect_player[random_num(0, sizeof grenade_infect_player - 1)], 1.0, ATTN_NORM, 0, PITCH_NORM)
               
                SendDeathMsg(attacker, victim) // send death notice
                FixDeadAttrib(victim) // fix the "dead" attrib on scoreboard
                UpdateFrags(attacker, victim, 1, 1, 1) // add corresponding frags & deaths               
               
                user_kill((victim, [1] )
                zp_respawn_user(victim, CS_TEAM_T)
                zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) + 1)
        }
        
        // Get rid of the grenade
        engfunc(EngFunc_RemoveEntity, id)

}
// Infection Grenade: Green Blast
create_blast(const FloatriginF[3])
{
        // Smallest ring
        engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, originF, 0)
        write_byte(TE_BEAMCYLINDER) // TE id
        engfunc(EngFunc_WriteCoord, originF[0]) // x
        engfunc(EngFunc_WriteCoord, originF[1]) // y
        engfunc(EngFunc_WriteCoord, originF[2]) // z
        engfunc(EngFunc_WriteCoord, originF[0]) // x axis
        engfunc(EngFunc_WriteCoord, originF[1]) // y axis
        engfunc(EngFunc_WriteCoord, originF[2]+385.0) // z axis
        write_short(g_exploSpr) // sprite
        write_byte(0) // startframe
        write_byte(0) // framerate
        write_byte(4) // life
        write_byte(60) // width
        write_byte(0) // noise
        write_byte(0) // red
        write_byte(200) // green
        write_byte(0) // blue
        write_byte(200) // brightness
        write_byte(0) // speed
        message_end()
        
        // Medium ring
        engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, originF, 0)
        write_byte(TE_BEAMCYLINDER) // TE id
        engfunc(EngFunc_WriteCoord, originF[0]) // x
        engfunc(EngFunc_WriteCoord, originF[1]) // y
        engfunc(EngFunc_WriteCoord, originF[2]) // z
        engfunc(EngFunc_WriteCoord, originF[0]) // x axis
        engfunc(EngFunc_WriteCoord, originF[1]) // y axis
        engfunc(EngFunc_WriteCoord, originF[2]+470.0) // z axis
        write_short(g_exploSpr) // sprite
        write_byte(0) // startframe
        write_byte(0) // framerate
        write_byte(4) // life
        write_byte(60) // width
        write_byte(0) // noise
        write_byte(0) // red
        write_byte(200) // green
        write_byte(0) // blue
        write_byte(200) // brightness
        write_byte(0) // speed
        message_end()
        
        // Largest ring
        engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, originF, 0)
        write_byte(TE_BEAMCYLINDER) // TE id
        engfunc(EngFunc_WriteCoord, originF[0]) // x
        engfunc(EngFunc_WriteCoord, originF[1]) // y
        engfunc(EngFunc_WriteCoord, originF[2]) // z
        engfunc(EngFunc_WriteCoord, originF[0]) // x axis
        engfunc(EngFunc_WriteCoord, originF[1]) // y axis
        engfunc(EngFunc_WriteCoord, originF[2]+555.0) // z axis
        write_short(g_exploSpr) // sprite
        write_byte(0) // startframe
        write_byte(0) // framerate
        write_byte(4) // life
        write_byte(60) // width
        write_byte(0) // noise
        write_byte(0) // red
        write_byte(200) // green
        write_byte(0) // blue
        write_byte(200) // brightness
        write_byte(0) // speed
        message_end()
}
// Fix Dead Attrib on scoreboard
FixDeadAttrib(id)
{
        message_begin(MSG_BROADCAST, g_msgScoreAttrib)
        write_byte(id) // id
        write_byte(0) // attrib
        message_end()
}

// Send Death Message for infections
SendDeathMsg(attacker, victim)
{
        message_begin(MSG_BROADCAST, g_msgDeathMsg)
        write_byte(attacker) // killer
        write_byte(victim) // victim
        write_byte(1) // headshot flag
        write_string("infection") // killer's weapon
        message_end()
}

// Update Player Frags and Deaths
UpdateFrags(attacker, victim, frags, deaths, scoreboard)
{
        // Set attacker frags
        set_pev(attacker, pev_frags, float(pev(attacker, pev_frags) + frags))
        
        // Set victim deaths
        fm_set_user_deaths(victim, fm_get_user_deaths(victim) + deaths)
        
        // Update scoreboard with attacker and victim info
        if (scoreboard)
        {
                message_begin(MSG_BROADCAST, g_msgScoreInfo)
                write_byte(attacker) // id
                write_short(pev(attacker, pev_frags)) // frags
                write_short(fm_get_user_deaths(attacker)) // deaths
                write_short(0) // class?
                write_short(fm_get_user_team(attacker)) // team
                message_end()
               
                message_begin(MSG_BROADCAST, g_msgScoreInfo)
                write_byte(victim) // id
                write_short(pev(victim, pev_frags)) // frags
                write_short(fm_get_user_deaths(victim)) // deaths
                write_short(0) // class?
                write_short(fm_get_user_team(victim)) // team
                message_end()
        }
}

can ?????
新手唔識
回復 支持 反對

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

小黑屋|Archiver|手機版|Nakuz.com |網站地圖

GMT+8, 10-5-2025 08:08 , Processed in 0.024515 second(s), 12 queries , MemCache On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回復 返回頂部 返回列表