Raised This Month: $ Target: $400
 0% 

respawn players where is the entity


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
apocalips
Member
Join Date: Aug 2008
Old 09-04-2009 , 10:57   Re: respawn players where is the entity
Reply With Quote #2

Code:
public revive(id)
{

new reviveEnt = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString,"info_target"));
 

 set_pev(reviveEnt, pev_classname, "revive");
 get_user_origin(id, aimVector, 3)
 
 
 IVecFVec(aimVector, fOrigin);
 
 set_pev(reviveEnt, pev_origin, fOrigin);

 engfunc(EngFunc_SetModel, reviveEnt, reviveModel);

set_pev(reviveEnt,pev_solid,SOLID_BBOX);

set_pev(reviveEnt,pev_health,500.0);
set_pev(reviveEnt,pev_max_health,500.0);
    
set_pev(reviveEnt,pev_takedamage,DAMAGE_AIM)

engfunc(EngFunc_SetSize, reviveEnt, Float:{-30.0, -30.0, -10.0}, Float:{30.0, 30.0, 10.0} )



return FMRES_IGNORED
}

 
public respawn_player(id,reviveEnt)
{
    
    
    if(!pev_valid(reviveEnt))
    return FMRES_IGNORED;

    new classname[32]
    pev(reviveEnt,pev_classname,classname,31)

    if(!equal(classname, "revive"))  
        return FMRES_IGNORED;
    
    
    
    entity_get_vector(reviveEnt,EV_VEC_origin,g_origin)
    
    if (!is_user_connected(id) || is_user_alive(id) || cs_get_user_team(id) == CS_TEAM_SPECTATOR)
    return;

    
    
    set_pev(id, pev_deadflag, DEAD_RESPAWNABLE)
    dllfunc(DLLFunc_Think, id)
        
    dllfunc(DLLFunc_Spawn, id)
    
    
    

    
    g_origin[2] += 60
    entity_set_origin(id, g_origin);

}
I tried but not work ,and sorry for double post

Last edited by Exolent[jNr]; 09-04-2009 at 14:06. Reason: Added [CODE] tags.
apocalips is offline
Send a message via Yahoo to apocalips
 



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 15:14.


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