Raised This Month: $ Target: $400
 0% 

Suggestion / Subplugin Request Request zombie headshot no respawn


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
indradullanov
Member
Join Date: Sep 2012
Location: Indonesian
Old 05-25-2013 , 07:03   Request zombie headshot no respawn
Reply With Quote #1

request kill zombie headshot no respawn please
indradullanov is offline
Send a message via Yahoo to indradullanov
GraviAnt
Senior Member
Join Date: Oct 2010
Old 05-25-2013 , 16:59   Re: Request zombie headshot no respawn
Reply With Quote #2

This plugin is not mine. All credits goes to jc980.

PHP Code:
/*-------------------------------------------------------------------------------------------------*

        [ Zombie Plague 4.3 Plugin Addon: ZP CSO Theme's Respawn Method ]
        
                    [ By jc980 ] 
                    
                [ Request By louistds ]
            
    
*-------------------------------------------------------------------------------------------------*/

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

new const ZP_CSO_PLUGIN_NAME[] = "[ZP] CSO In-Game Theme"
new const ZP_CSO_PLUGIN_VERSION[] = "4.0"
new const ZP_CSO_PLUGIN_AUTHOR[] = "jc980"

new zp_cso_roundstartedzp_center_textmsgzp_cso_roundzp_cso_humanswinszp_cso_zombieswinszp_cso_hud_sync1
new zp_cso_total_spawn 0bool:zp_cso_first_spawn[33
new 
Floatzp_cso_spawn_vec[60][3], Floatzp_cso_spawn_angle[60][3], Floatzp_cso_spawn_v_angle[60][3]
new 
zp_cso_respawnsprzp_cso_respawnwait[33]

new 
zp_cso_cvar_enablerespawnzp_cso_cvar_delayrespawn

new const zp_cso_zombierespawn[][] = 
{
    
"zombie_plague/cso/zombi_comeback.wav"
}

new 
zp_cso_respawnsprite[][] = 
{
    
"sprites/zombie_plague/cso/zp_zbrespawn.spr"
}

public 
plugin_init() 
{
    
register_plugin(ZP_CSO_PLUGIN_NAMEZP_CSO_PLUGIN_VERSIONZP_CSO_PLUGIN_AUTHOR)
    
    
register_event("HLTV""zp_cso_round_start""a""1=0""2=0")
    
register_event("DeathMsg""zp_cso_death""a")
    
    
zp_cso_cvar_enablerespawn register_cvar("zp_csotheme_enable_respawn""1")
    
zp_cso_cvar_delayrespawn register_cvar("zp_csotheme_delay_respawn""5.0")
    
    
zp_center_textmsg get_user_msgid("TextMsg")
    
    
server_cmd("exec addons/amxmodx/configs/zp_cso_theme.cfg")
    
    
csdm_respawn()
}

public 
plugin_precache()
{
    
register_dictionary("zp_cso_theme.txt")
    
    new 
i
        
    
for(0sizeof zp_cso_zombierespawni++) 
        
engfunc(EngFunc_PrecacheSoundzp_cso_zombierespawn[i])

    for(
0sizeof zp_cso_respawnspritei++) 
        
zp_cso_respawnspr engfunc(EngFunc_PrecacheModelzp_cso_respawnsprite[i])
}

public 
zp_cso_round_start()
{
    
zp_cso_round += 1
}

csdm_respawn()
{   
    new 
zp_map[32], zp_config[32],  zp_mapfile[64]
    
    
get_mapname(zp_map31)
    
get_configsdir(zp_config31)
    
    
format(zp_mapfile63"%s\csdm\%s.spawns.cfg"zp_configzp_map)
    
    
zp_cso_total_spawn 0
    
    
if (file_exists(zp_mapfile)) 
    {
        new 
zp_new_data[124], zp_len
        
new zp_line 0
        
new zp_pos[12][8]
        
        while(
zp_cso_total_spawn 60 && (zp_line read_file(zp_mapfile zp_linezp_new_data123zp_len)) != 0
        {
            if (
strlen(zp_new_data) < || zp_new_data[0] == '[')
                continue
                
            
parse(zp_new_datazp_pos[1], 7zp_pos[2], 7zp_pos[3], 7zp_pos[4], 7zp_pos[5], 7zp_pos[6], 7zp_pos[7], 7zp_pos[8], 7zp_pos[9], 7zp_pos[10], 7)    
            
            
zp_cso_spawn_vec[zp_cso_total_spawn][0] = str_to_float(zp_pos[1])
            
zp_cso_spawn_vec[zp_cso_total_spawn][1] = str_to_float(zp_pos[2])
            
zp_cso_spawn_vec[zp_cso_total_spawn][2] = str_to_float(zp_pos[3])    
            
            
zp_cso_spawn_angle[zp_cso_total_spawn][0] = str_to_float(zp_pos[4])
            
zp_cso_spawn_angle[zp_cso_total_spawn][1] = str_to_float(zp_pos[5])
            
zp_cso_spawn_angle[zp_cso_total_spawn][2] = str_to_float(zp_pos[6])    
            
            
zp_cso_spawn_v_angle[zp_cso_total_spawn][0] = str_to_float(zp_pos[8])
            
zp_cso_spawn_v_angle[zp_cso_total_spawn][1] = str_to_float(zp_pos[9])
            
zp_cso_spawn_v_angle[zp_cso_total_spawn][2] = str_to_float(zp_pos[10])
            
            
zp_cso_total_spawn += 1
        
}    
        
        if (
zp_cso_total_spawn >= && get_pcvar_num(zp_cso_cvar_enablerespawn) == 1)
        {
            
RegisterHam(Ham_Spawn"player""zp_cso_zombie_spawn"1)
        }
    }
    
    return 
1
}

public 
zp_cso_zombie_spawn(id)
{
    if (!
is_user_alive(id) || !zp_get_user_zombie(id))
        return 
PLUGIN_CONTINUE
        
    
if (zp_cso_first_spawn[id])
    {
        
zp_cso_first_spawn[id] = false
        
        
return PLUGIN_CONTINUE
    
}
    
    new 
zp_list[60]
    new 
zp_num 0
    
new zp_final = -1
    
new zp_total 0
    
new zp_players[32], zp_nozp_xo 0
    
new Float:zp_location[32][3], zp_locnum
    
    get_players
(zp_players,zp_num)
    
    for (new 
i=0i<zp_numi++)
    {
        if (
is_user_alive(zp_players[i]) && zp_players[i] != id)
        {
            
pev(zp_players[i], pev_originzp_location[zp_locnum])
            
zp_locnum++
        }
    }
    
    
zp_num 0
    
    
while (zp_num <= zp_cso_total_spawn)
    {
        if (
zp_num == zp_cso_total_spawn)
            break
            
        
zp_no random_num(0zp_cso_total_spawn 1)
        
        if (!
zp_list[zp_no])
        {
            
zp_list[zp_no] = 1
            zp_num 
+= 1
        

        else 
        {
            
zp_total += 1
            
if (zp_total 100)
                break
                
            continue  
        }
        
        if (
zp_locnum 1)
        {
            
zp_final zp_no
            
break
        }
        
        
zp_final zp_no
        
        
for (zp_xo 0zp_xo zp_locnumzp_xo++)
        {
            new 
Floatzp_distance get_distance_f(zp_cso_spawn_vec[zp_no], zp_location[zp_xo])
            
            if (
zp_distance 250.0)
            {
                
zp_final = -1
                
break
            }
        }
        
        if (
zp_final != -1)
            break
    }
    
    if (
zp_final != -1)
    {
        new 
Float:mins[3], Float:maxs[3]
        
        
pev(idpev_minsmins)
        
pev(idpev_maxsmaxs)
        
        
engfunc(EngFunc_SetSizeidminsmaxs)
        
engfunc(EngFunc_SetOriginidzp_cso_spawn_vec[zp_final])
        
        
set_pev(idpev_fixangle1)
        
set_pev(idpev_angleszp_cso_spawn_angle[zp_final])
        
set_pev(idpev_v_anglezp_cso_spawn_v_angle[zp_final])
        
set_pev(idpev_fixangle1)
    }
    
    return 
PLUGIN_CONTINUE


public 
zp_cso_death()
{
    new 
iKiller read_data(1)
    new 
iVictim read_data(2)
    new 
iHeadshot read_data(3)
    new 
FloatiDelay
    
    
if(iKiller == iVictim)
        return 
PLUGIN_CONTINUE
        
    
if(zp_get_user_zombie(iVictim))
    {
        if(!
iHeadshot)
        {
            
iDelay get_pcvar_float(zp_cso_cvar_delayrespawn)
            
set_task(iDelay,"zp_cso_zombie_respawner"iVictim)
            
            
zp_cso_respawnwait[iVictim] = get_pcvar_num(zp_cso_cvar_delayrespawn)
            
            
zp_zbrespawn(iVictim)
            
zp_zbrespawn_msg(iVictim)
        }
        else
        {
            
zp_zbrespawn_msg2(iVictim)
        }
    }
    
    return 
PLUGIN_CONTINUE
}

public 
zp_zbrespawn(iVictim)
{
    if (
zp_cso_roundstarted == || !is_user_connected(iVictim) || is_user_alive(iVictim))
        return 
PLUGIN_CONTINUE

    zp_effect_respawn
(iVictim)
    
set_task(2.0"zp_zbrespawn"iVictim)
    
    return 
PLUGIN_CONTINUE
}

public 
zp_zbrespawn_msg(iVictim)
{
    if (
zp_cso_roundstarted == || !is_user_connected(iVictim))
        return 
PLUGIN_CONTINUE
        
    
new iText[64]

    
format(iTextcharsmax(iText), "%L"LANG_PLAYER"ZP_CSO_ZOMBIERESPAWN_MSG"zp_cso_respawnwait[iVictim])
    
zp_clientcenter_text(iVictimiText)
    
    
zp_cso_respawnwait[iVictim] -= 1
    
    
if(zp_cso_respawnwait[iVictim] >= 1)
    {
        
set_task(1.0"zp_zbrespawn_msg"iVictim)
    }
    
    return 
PLUGIN_CONTINUE
}

public 
zp_zbrespawn_msg2(iVictim)
{
    if (
zp_cso_roundstarted == || !is_user_connected(iVictim) || is_user_alive(iVictim))
        return 
PLUGIN_CONTINUE
        
    
new iText[64]

    
format(iTextcharsmax(iText), "%L"LANG_PLAYER"ZP_CSO_ZOMBIERESPAWN_MSG2")
    
zp_clientcenter_text(iVictimiText)
    
    return 
PLUGIN_CONTINUE
}

public 
zp_cso_auto_on(id)
{
    
set_task(1.0,"zp_cso_hud_score"id__"b")
}

public 
zp_cso_hud_score(id)
{
    if(!
is_user_alive(id))
        return 
PLUGIN_CONTINUE
    
    
new iMsg[600], zp_hmnumzp_zbnumzp_roundnum
    
    zp_hmnum 
zp_get_human_count()
    
zp_zbnum zp_get_zombie_count()
    
zp_roundnum zp_cso_round
    
    set_hudmessage
02500, -1.00.006.01.10.00.0, -1)
    
format(iMsgcharsmax(iMsg), "/ %L \^n( HM [ %L ] | %02i | [ %L %02i ] | %02i | [ %L ] ZB )^n\ | %02i | [ VS ] | %02i | /"LANG_PLAYER"ZP_CSO_TITLE"LANG_PLAYER"ZP_CSO_HUMANS"zp_cso_humanswinsLANG_PLAYER"ZP_CSO_ROUNDS"zp_roundnumzp_cso_zombieswinsLANG_PLAYER"ZP_CSO_ZOMBIES"zp_hmnumzp_zbnum)
    
ShowSyncHudMsg(idzp_cso_hud_sync1iMsg)
    
    return 
PLUGIN_CONTINUE
}

zp_effect_respawn(iVictim)
{
    static 
Floatzp_origin[3]
    
    
pev(iVictimpev_originzp_origin)
    
    
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
    
    
write_byte(TE_EXPLOSION)
    
    
write_coord(floatround(zp_origin[0]))
    
write_coord(floatround(zp_origin[1]))
    
write_coord(floatround(zp_origin[2]))
    
    
write_short(zp_cso_respawnspr)
    
    
write_byte(10)
    
write_byte(20)
    
write_byte(14)
    
    
message_end()
}

public 
zp_cso_zombie_respawner(iVictim)
{
    if(
get_pcvar_num(zp_cso_cvar_enablerespawn) == 1)
    {
        new 
iSoundiSpeak[64]
        
        
ExecuteHamB(Ham_CS_RoundRespawniVictim)
        
        
iSound random_num(0charsmax(zp_cso_zombierespawn))
        
copy(iSpeakcharsmax(iSpeak), zp_cso_zombierespawn[iSound])
        
client_cmd(0"speak ^"%s^""iSpeak)
        
        
zp_infect_user(iVictim)
    }
}

public 
zp_round_started()
{
    
zp_cso_roundstarted 1
}

public 
zp_round_ended()
{
    if(
zp_get_human_count() == 0)
    {
        
zp_cso_zombieswins += 1
    
}
    else
    {
        
zp_cso_humanswins += 1
    
}
    
zp_cso_roundstarted 0
}

public 
client_putinserver(id
{
    
zp_cso_auto_on(id)
}

stock zp_clientcenter_text(idzp_message[])
{
    new 
dest
    
if (iddest MSG_ONE
    
else dest MSG_ALL
    
    message_begin
(destzp_center_textmsg, {0,0,0}, id)
    
write_byte(4)
    
write_string(zp_message)
    
message_end()

GraviAnt is offline
Reply



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 00:04.


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