Raised This Month: $ Target: $400
 0% 

ExecuteHamB(Ham_CS_RoundRespawn, victim)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
FlyingHorse
Senior Member
Join Date: Apr 2010
Location: Under your bed.
Old 05-25-2010 , 13:41   ExecuteHamB(Ham_CS_RoundRespawn, victim)
Reply With Quote #1

Why doesn't the respawn on my plugin work? When i die nothing happens..

PHP Code:
#include <amxmodx>
#include <fun>
#include <engine>
#include <hamsandwich>
#include <cstrike>
#include <csx>
#include <colorchat>

new g_szVictimSound[100], g_szKillerSound[100], g_szPlayersSound[100]
new 
g_iMaxPlayers
new const PLUGIN[ ] = "Rambo mod"
new const VERSION[ ] = "1.2"
new const AUTHOR[ ] = "FlyingHorse"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
RegisterHam(Ham_Spawn"player""Event_Player_Spawn"1)
    
RegisterHam(Ham_Killed"player""Event_Ham_Killed")
    
register_event("DeathMsg""eDeathMsg_HeadShot""a""1>0""3=1")
}

public 
client_putinserver(id)
{
    
set_task(15.0"advertisement"id)
}

public 
advertisement(id)
{
    
ColorChat(idRED"^x04[Rambo Mod]^x01 This server is using^x03 Rambo mod^x04 v%s^x01 by^x04 FlyingHorse^x01."VERSION)
}
public 
plugin_precache()
{
    
precache_sound("fvox/blip.wav")
    new 
szFile[64]
    
get_localinfo("amxx_configsdir"szFile63)
    
format(szFile63"%s/headshots.ini"szFile)

    new 
File fopen(szFile"rt")
    if(!
File)
    {
        
pause("ad")
        return
    }

    new 
Text[128], Witch[8], Sound[100]
    while(!
feof(File))
    {
        
fgets(FileText127)
        
trimText )
        if(!
Text[0] || Text[0] == ';' || (Text[0] == '/' && Text[1] == '/'))
        continue

        
parse(TextWitch7Sound99)
        if(!
g_szVictimSound[0] && equal(Witch"victim"))
        {
            
copy(g_szVictimSound99Sound)
            
precache_sound(g_szVictimSound)
        }
        else if(!
g_szKillerSound[0] && equal(Witch"killer"))
        {
            
copy(g_szKillerSound99Sound)
            
precache_sound(g_szKillerSound)
        }
        else if(!
g_szPlayersSound[0] && equal(Witch"players"))
        {
            
copy(g_szPlayersSound99Sound)
            
precache_sound(g_szPlayersSound)
        }
    }
    
fclose(File)
}


public 
Event_Player_Spawn(id)
{    
    if(
is_user_alive(id))
    {
        
set_user_maxspeed(id350.0)
        
set_task(0.1"player_glowteam"id)
        
client_cmd(id,"spk ^"fvox/blip^"")
        
ColorChat(idGREEN"^x04[Rambo Mod]^x01 You Respawned!")
        
strip_user_weapons(id)
        
give_item(id"weapon_knife")
        
cs_set_weapon_ammo(give_item(id"weapon_deagle"), 20)
        
cs_set_weapon_ammo(give_item(id"weapon_m249"), 200)
        
cs_set_weapon_ammo(give_item(id"weapon_hegrenade"), 10)
        
cs_set_user_bpammo(idCSW_DEAGLE100)
        
cs_set_user_bpammo(idCSW_M2491000)
    }
}
public 
Event_Ham_Killed(victimattackershouldgib)
{
    new 
attackername[33]
    
get_user_name(attackerattackername32)
    if(
is_user_connected(victim))
    
ColorChat(victimGREEN"^x04[Rambo Mod]^x01 You got owned by^x04 %s"attackername)
    
ExecuteHamB(Ham_CS_RoundRespawnvictim)


public 
player_glowteam(id)
{
    if(
cs_get_user_team(id) == CS_TEAM_CT)
    {
        
set_user_rendering(idkRenderFxGlowShell00255kRenderNormal16)
    }
    else if(
cs_get_user_team(id) == CS_TEAM_T)
    
set_user_rendering(idkRenderFxGlowShell25500kRenderNormal16)
}

public 
plugin_cfg()
{
    
g_iMaxPlayers get_maxplayers()
}

public 
eDeathMsg_HeadShot()
{
    new 
iKiller read_data(1)

    if(
iKiller g_iMaxPlayers)
        return

    new 
iVictim read_data(2)
    if(
iKiller == iVictim)
        return

    if(
g_szKillerSound[0])
        
emit_sound(iKillerCHAN_VOICEg_szKillerSoundVOL_NORMATTN_STATIC0PITCH_NORM)

    if(
g_szVictimSound[0])
        
client_cmd(iVictim"speak %s"g_szVictimSound)

    if(
g_szPlayersSound[0])
    {
        for(new 
id 1id <= g_iMaxPlayersid++)
        {
            if(!
is_user_connected(id))
                continue
            if((
g_szKillerSound[0] && id == iKiller) || (g_szVictimSound[0] && id == iVictim))
                continue
            
client_cmd(id"speak %s"g_szPlayersSound)
        }
    }

FlyingHorse is offline
Send a message via Skype™ to FlyingHorse
 



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 05:22.


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