View Single Post
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 11-01-2009 , 10:38   Re: Help with SyncHud
Reply With Quote #2

Try this (not tested)

PHP Code:
// Global
new respawntimer[32]
new 
respawnsegs[32]
new 
delay

public plugin_init()
{
    
delay register_cvar("amx_respawn_delay""3.0")
}

//Function to Init timer
public respawnFunc(player)
{
    new 
param[1]
    
param[0] = player
    respawntimer
[player] = CreateHudSyncObj()
    
respawnsegs[player] = get_pcvar_num(delay)
    
set_task(1.0"CmdHud"player TASK_HUDparam_"b")
}

// Function CmdHud
public CmdHud(param[])
{        
    
player param[0]

    if(
respawnsegs[player] <= 0)
    {
        
remove_task(player TASK_HUD)
        
chat_color(player"!g%s!y Para deshabilitar tu respawn,tipea!team /respawn!y."szPrefix)
    }
    else
    {
        
set_hudmessage(255255255, -1.00.7906.01.00.10.2)
        
ShowSyncHudMsg(playerrespawntimer[player], "Respawnearas en %d segundo%s"respawnsegs[id], get_pcvar_num(delay) < "" "s")
    }
    
respawnsegs[id]--

Add your code to call respawnFunc with player id as a parameter.
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito