Raised This Month: $ Target: $400
 0% 

ExecuteHamB(Ham_CS_RoundRespawn, victim)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 05-26-2010 , 13:42   Re: ExecuteHamB(Ham_CS_RoundRespawn, victim)
Reply With Quote #1

@ Connor:
Will supercede in pre block the victim from dying to?

Example:

PHP Code:
#include <amxmodx>
#include <hamsandwich>

public plugin_init()
{
    
RegisterHam(Ham_Killed"player""Ham_Killed_Pre"0)        // Player isn't death yet
    
RegisterHam(Ham_Killed"player""Ham_Killed_Post"1)        // Player is death
    // Other stuff
}

public 
Ham_Killed_Pre(victimattackershouldgib)    // Player isn't death, block it
    
return HAM_SUPERCEDE    // Blocks stuff from happening

public Ham_Killed_Post(victimattackershouldgib)    // Player is death, respawn him    
    
ExecuteHamb(Ham_CS_RoundRespawnvictim)    // Respawns the victim 
if you want a bigger delay use set_task like this:
PHP Code:
#include <amxmodx>
#include <hamsandwich>

public plugin_init()
{
    
RegisterHam(Ham_Killed"player""Ham_Killed_Pre"0)        // Player isn't death yet
    
RegisterHam(Ham_Killed"player""Ham_Killed_Post"1)        // Player is death
    // Other stuff
}

public 
Ham_Killed_Pre(victimattackershouldgib)    // Player isn't death, block it
    
return HAM_SUPERCEDE

public Ham_Killed_Post(victimattackershouldgib)    // Player is death, respawn him    
    
set_task(5.0"respawn"victim)
    
public 
respawn(id)
    
ExecuteHamB(Ham_CS_RoundRespawnid
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.

Last edited by drekes; 05-26-2010 at 13:46.
drekes is offline
Send a message via MSN to drekes
FlyingHorse
Senior Member
Join Date: Apr 2010
Location: Under your bed.
Old 05-26-2010 , 13:55   Re: ExecuteHamB(Ham_CS_RoundRespawn, victim)
Reply With Quote #2

solved already .. i made this:
PHP Code:
public Event_Ham_Killed(victimattackershouldgib)
{
    new 
attackername[33]
    
get_user_name(attackerattackername32)
    if(
is_user_connected(victim))
    
set_hudmessage(00255, -1.0, -1.0)
    
show_hudmessage(victim"You got owned by %s"attackername)
    
set_task(1.0"respawn"victim)
}

public 
respawn(victimattackershouldgib)
{
    new 
attackername[33]
    
get_user_name(attackerattackername32)
    
ExecuteHamB(Ham_CS_RoundRespawnvictim)

I added a task to delay with 1 second so u dont respawn instantly when u die.. kinda confusing
FlyingHorse is offline
Send a message via Skype™ to FlyingHorse
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 05-26-2010 , 15:28   Re: ExecuteHamB(Ham_CS_RoundRespawn, victim)
Reply With Quote #3

Quote:
Originally Posted by FlyingHorse View Post
solved already .. i made this:
<ugly code that has errors>

I added a task to delay with 1 second so u dont respawn instantly when u die.. kinda confusing
Or you could've just registered it as post and saved yourself from the set_task and new functions...
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
Kreation
Veteran Member
Join Date: Jan 2010
Location: Illinois
Old 05-26-2010 , 16:51   Re: ExecuteHamB(Ham_CS_RoundRespawn, victim)
Reply With Quote #4

Quote:
Originally Posted by FlyingHorse View Post
solved already .. i made this:
PHP Code:
public respawn(victimattackershouldgib)
{
    new 
attackername[33]
    
get_user_name(attackerattackername32)
    
ExecuteHamB(Ham_CS_RoundRespawnvictim)

I added a task to delay with 1 second so u dont respawn instantly when u die.. kinda confusing
Why do you have 'attackername' and the function get_user_name if you don't use that variable in the function? You can just delete that.. And at the top, since you're not going to be using attacker you can take that out and take out the shouldgib too.
__________________
Hi.
Kreation 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 05:22.


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