Raised This Month: $ Target: $400
 0% 

Respawning player right after death


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Desikac
Senior Member
Join Date: Apr 2010
Location: Serbia
Old 06-16-2011 , 09:33   Respawning player right after death
Reply With Quote #1

How can I respawn a player 1 second after death?

PHP Code:
public death() {
    new 
attacker read_data(1);
    new 
victim read_data(2);
    new 
headshot read_data(3)
    new 
weapon[11]
    
read_data(4weapon11)
    
    if(
equal(weapon"grenade"))
        return 
PLUGIN_CONTINUE
       
    
if(attacker == victim)
        return 
PLUGIN_CONTINUE
     
    
if(headshot)
        return 
PLUGIN_CONTINUE
    
    
new origin[3]
    
get_user_origin(victimorigin0//remember the position
    
if(random_num(1,10) == 2) { //10% chance
        
set_task(0.9"lstchn"victimorigin3)
    }
    
    return 
PLUGIN_CONTINUE
    
}

public 
lstchn(victimorigin[3]) {
    
spawn(victim)

The code above gives me the error: [FUN] Entity out of range (4804).
Tried ExecuteHamB(Ham_CS_RoundRespawn,victim), same error.
Also tried http://forums.alliedmods.net/showpos...4&postcount=19 and I get another error: [FAKEMETA] Invalid entity
Desikac is offline
Send a message via MSN to Desikac Send a message via Skype™ to Desikac
 



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 23:31.


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