Raised This Month: $ Target: $400
 0% 

respawn mod?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
liryck
Senior Member
Join Date: Mar 2007
Location: Venezuela
Old 05-04-2010 , 15:43   respawn mod?
Reply With Quote #1

i all im trying to make a simple respawn the thing is that sometimes when the player respawn the crossair gone with the hp, shield and round timer.

you just can't see it?

this is my code maybe u will say that's a ugly code etc etc but well i do my best if you could fix it or post a more simple code that do what im trying be welcome

PHP Code:
public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
//RegisterHam( Ham_Killed , "player", "HAM_Killed" )
    
    //gmsgStatusIcon = get_user_msgid("StatusIcon");
    
    
g_pEnabled register_cvar("dm_enabled","0")
    
g_pProtection register_cvar("dm_protection","1")
    
g_pProtectionTime register_cvar("dm_protection_time","3")
    
    
g_msgid_ClCorpse get_user_msgid("ClCorpse")
    
    
register_event"TeamInfo""join_team""a");
    
register_event("DeathMsg""death_mes""a");
    
register_event("StatusIcon","GotBomb","be","1=1","1=2","2=c4");
}

public 
client_connect(id)
{
    
g_connected[id] = false
}

public 
spawnagain(id)
{
    
//Make sure he didn't disconnect in the 0.5 seconds that have passed.
    
if(is_user_connected(id))
    {
        
//Spawn player
    
spawn(id)
    
set_msg_block(g_msgid_ClCorpseBLOCK_ONCE)
    
    if ( 
get_pcvar_numg_pProtection ) == )
     {
        
set_user_godmode(id,1)
        new 
Float:protect get_pcvar_floatg_pProtectionTime )
        
set_task(protect,"stopprotect",id)
        
set_task(1.1,"giveweapon",id)
    }

        
//After 1.0 the player will be spawned fully and you can mess with the ent (give weapons etc)
        //set_task(1.0,"player_fully_spawned",id)
    
}
}

public 
giveweapon(id)
{
    if ( 
get_user_teamid ) == 
    { 
        
give_item(id,"weapon_knife"
        
give_item(id,"weapon_glock18"
        
give_item(id,"ammo_9mm"
        
give_item(id,"ammo_9mm"
        
cs_set_user_money(id,16000)
    } 
    else 
    { 
        
give_item(id,"weapon_knife"
        
give_item(id,"weapon_usp"
        
give_item(id,"ammo_45acp"
        
give_item(id,"ammo_45acp"
        
cs_set_user_money(id,16000)
    } 
}

public 
stopprotect(id)
{
    if(
is_user_alive(id))
    
set_user_godmode(id)
}

public 
check_alive(id)
{
    if(!
get_pcvar_num(g_pEnabled) || !is_user_connected(id) || is_user_alive(id)){
        return;
    }
    else
    {
        if(!
is_user_alive(id))
        {
            
set_task(1.0,"spawnagain",id)
        }
    }
}

public 
death_mes()
{
    new 
victim read_data(2);
    
    if(
get_pcvar_num(g_pEnabled))
    {
        
set_task(1.0,"check_alive",victim)
    }
    return 
PLUGIN_HANDLED;
}

public 
join_team()
{    
    new 
id read_data(1)
    static 
user_team[32]

    
read_data(2user_team31)    
    
    if(!
is_user_connected(id))
        return 
PLUGIN_CONTINUE    
    
    
switch(user_team[0])
    {
        case 
'C':  
        {        
        if(
g_connected[id] == false && get_pcvar_num(g_pEnabled)){
            
            
set_task(6.0,"check_alive",id)
            
g_connected[id] = true
        
}     
        }
            
        case 
'T'
        {
                if(
g_connected[id] == false && get_pcvar_num(g_pEnabled)){
            
            
set_task(6.0,"check_alive",id)
            
g_connected[id] = true
        
}    
        }        
    }
    return 
PLUGIN_CONTINUE
    

liryck is offline
Send a message via MSN to liryck
 


Thread Tools
Display Modes

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 03:39.


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