Raised This Month: $ Target: $400
 0% 

respawn plugin help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-12-2012 , 15:23   Re: respawn plugin help
Reply With Quote #1

Try :

PHP Code:
#include <amxmodx>

#include <cstrike>
#include <fakemeta>
#include <hamsandwich>
#include <fun>

#define PLUGIN "Respawn"
#define VERSION "1.0"
#define AUTHOR "01"

new g_iCountdown[33]
new 
g_pCvarRespawnDelay

enum _
:PlayersTasksOffsets (+=33) {
    
TASK_PLAYER_RESPAWN,
// id %= 33 in task callback


public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
g_pCvarRespawnDelay register_cvar("amx_respawn_delay""20")
    
RegisterHam(Ham_Killed"player""CBasePlayer_Killed_Post"true)
}

public 
CBasePlayer_Killed_Post(id)
{
    
g_iCountdown[id] = get_pcvar_num(g_pCvarRespawnDelay)

    
remove_task(id TASK_PLAYER_RESPAWN)
    
set_task(1.0"fin"id TASK_PLAYER_RESPAWN, .flags="b")
    
ShowPlayerRespawnTimeid )
    --
g_iCountdown[id]
}

ShowPlayerRespawnTimeid )
{
    
set_hudmessage(02550, -1.00.406.01.0, .channel = -1)
    
show_hudmessage(id"Respawn za : %d"g_iCountdown[id]) 
}

public 
fin(task_id)
{
    new 
id task_id 33

    
if( !is_user_connected(id) || is_user_alive(id) )
    {
        
remove_tasktask_id )
        return
    }

    if(
g_iCountdown[id] <= 0)
    {
        
remove_task(task_id)
        
ExecuteHam(Ham_CS_RoundRespawnid)
        return
    }

    
ShowPlayerRespawnTimeid )

    --
g_iCountdown[id]

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
kp3t3h
Senior Member
Join Date: Feb 2011
Old 05-12-2012 , 15:36   Re: respawn plugin help
Reply With Quote #2

Quote:
Originally Posted by ConnorMcLeod View Post
Try :

PHP Code:
#include <amxmodx>

#include <cstrike>
#include <fakemeta>
#include <hamsandwich>
#include <fun>

#define PLUGIN "Respawn"
#define VERSION "1.0"
#define AUTHOR "01"

new g_iCountdown[33]
new 
g_pCvarRespawnDelay

enum _
:PlayersTasksOffsets (+=33) {
    
TASK_PLAYER_RESPAWN,
// id %= 33 in task callback


public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
g_pCvarRespawnDelay register_cvar("amx_respawn_delay""20")
    
RegisterHam(Ham_Killed"player""CBasePlayer_Killed_Post"true)
}

public 
CBasePlayer_Killed_Post(id)
{
    
g_iCountdown[id] = get_pcvar_num(g_pCvarRespawnDelay)

    
remove_task(id TASK_PLAYER_RESPAWN)
    
set_task(1.0"fin"id TASK_PLAYER_RESPAWN, .flags="b")
    
ShowPlayerRespawnTimeid )
    --
g_iCountdown[id]
}

ShowPlayerRespawnTimeid )
{
    
set_hudmessage(02550, -1.00.406.01.0, .channel = -1)
    
show_hudmessage(id"Respawn za : %d"g_iCountdown[id]) 
}

public 
fin(task_id)
{
    new 
id task_id 33

    
if( !is_user_connected(id) || is_user_alive(id) )
    {
        
remove_tasktask_id )
        return
    }

    if(
g_iCountdown[id] <= 0)
    {
        
remove_task(task_id)
        
ExecuteHam(Ham_CS_RoundRespawnid)
        return
    }

    
ShowPlayerRespawnTimeid )

    --
g_iCountdown[id]

it works good now,
but the hud message is blurry

edti
nvm, got it working great now
__________________
need help with the following
no.1, no.2, no.3, no.4 no.5

Last edited by kp3t3h; 05-13-2012 at 04:44.
kp3t3h 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 00:23.


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