Raised This Month: $ Target: $400
 0% 

Problem wyth respawn plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 12-11-2014 , 09:15   Re: Problem wyth respawn plugin
Reply With Quote #1

Quote:
Originally Posted by zmd94 View Post
That loop is not needed if you use the code that I have posted.
Ok,so we just need to make check is user zombie wryght?
I dont need for humans just zombie .
Krtola is offline
Send a message via Skype™ to Krtola
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 12-11-2014 , 09:31   Re: Problem wyth respawn plugin
Reply With Quote #2

Yes, thats right.
zmd94 is offline
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 12-11-2014 , 09:58   Re: Problem wyth respawn plugin
Reply With Quote #3

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <biohazard>

public plugin_init()
{
    
register_plugin("Auto Respawn""1.0""zmd94")
    
    
RegisterHam(Ham_Killed"player""Ham_Killed_Post"1)
}

public 
Ham_Killed_Post(victimattackershouldgib)
{
    if(
is_user_connected(victim) && is_user_zombie(victim))
    {
        
set_task(5.0"iRespawn"victim)
    }
}
    
public 
iRespawn(id)
{
    
ExecuteHamB(Ham_CS_RoundRespawnid)  

That should do it.
Help me wyth screen print (example: you will be respawned..) and corpse remove please.
Krtola is offline
Send a message via Skype™ to Krtola
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 12-11-2014 , 10:09   Re: Problem wyth respawn plugin
Reply With Quote #4

Do you mean countdown?
zmd94 is offline
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 12-11-2014 , 10:14   Re: Problem wyth respawn plugin
Reply With Quote #5

Quote:
Originally Posted by zmd94 View Post
Do you mean countdown?
Not need,just to wryte on screen text.
Krtola is offline
Send a message via Skype™ to Krtola
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 12-11-2014 , 10:28   Re: Problem wyth respawn plugin
Reply With Quote #6

Just try below:
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <biohazard>

#define TASK_RESPAWN 1994

new g_iCount[33]
new 
g_iTimeg_HudSync

public plugin_init()
{
    
register_plugin("Auto Respawn""1.0""zmd94")
    
    
register_logevent("logevent_round_end"2"1=Round_End")
    
    
RegisterHam(Ham_Killed"player""Ham_Killed_Post"1)
    
    
g_iTime register_cvar("zp_respawn_wait""6")
    
    
g_HudSync CreateHudSyncObj()
}

public 
logevent_round_end()
{
    new 
iPlayers[32]
    new 
iPlayerCountiid
    
    get_players
(iPlayersiPlayerCount"c")
    for(
0iPlayerCounti++)
    {
        
id iPlayers[i]
        
remove_task(id+TASK_RESPAWN)
    }
}

public 
Ham_Killed_Post(victimattackershouldgib)
{
    if(
is_user_zombie(victim))
    {
        
g_iCount[id] = get_pcvar_num(g_iTime)
        
set_task(1.0"iCount"victim+TASK_RESPAWN__"b")
    }
}

public 
iCount(id)
{
    
id -= TASK_RESPAWN
    
if(!is_user_alive(id) && is_user_zombie(id))
    {
        if(
g_iCount[id] <= 1)
        {
            
iRespawn(id)
            
remove_task(id+TASK_RESPAWN)
        }
        
        
g_iCount[id]--
        
        
set_hudmessage(random_num(10,255), random(256), random(256), -1.00.1510.13.00.050.05, -1)
        
ShowSyncHudMsg(idg_HudSync,"Respawn in %d seconds!"g_iCount[id])
    }
}

public 
iRespawn(id)
{
    
ExecuteHamB(Ham_CS_RoundRespawnid)  


Last edited by zmd94; 12-13-2014 at 10:12.
zmd94 is offline
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 12-11-2014 , 10:38   Re: Problem wyth respawn plugin
Reply With Quote #7

Quote:
Originally Posted by zmd94 View Post
Just try below:
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <biohazard>

#define TASK_RESPAWN 1994

new g_iCount[33]
new 
g_iTimeg_HudSync

public plugin_init()
{
    
register_plugin("Auto Respawn""1.0""zmd94")
    
    
register_logevent("logevent_round_end"2"1=Round_End")
    
    
RegisterHam(Ham_Killed"player""Ham_Killed_Post"1)
    
    
g_iTime register_cvar("zp_respawn_wait""6")
    
    
g_HudSync CreateHudSyncObj()
}

public 
logevent_round_end()
{
    new 
iPlayers[32
    new 
iPlayerCountiid
    
    get_players
(iPlayersiPlayerCount"c"
    for(
0iPlayerCounti++)
    {
        
id iPlayers[i]
        
remove_task(id+TASK_RESPAWN)
    }
}

public 
Ham_Killed_Post(victimattackershouldgib)
{
    if(
is_user_alive(victim) && is_user_zombie(victim))
    {
        
set_task(get_pcvar_float(g_iTime), "iCount"victim+TASK_RESPAWN__"b")
    }
}

public 
iCount(id)
{
    
id -= TASK_RESPAWN
    
if(!is_user_alive(id) && is_user_zombie(id))
    {
        if(
g_iCount[id] <= 1)
        {
            
iRespawn(id)
            
remove_task(id+TASK_RESPAWN)
        }
        
        
g_iCount[id]--
        
        
set_hudmessage(random_num(10,255), random(256), random(256), -1.00.1510.13.00.050.05, -1)
        
ShowSyncHudMsg(idg_HudSync,"Respawn in %d seconds!"g_iCount[id])
    }
}

public 
iRespawn(id)
{
    
ExecuteHamB(Ham_CS_RoundRespawnid)  

I'm going to test it and I'll tell you if everything is OK.
Krtola is offline
Send a message via Skype™ to Krtola
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 12-11-2014 , 10:45   Re: Problem wyth respawn plugin
Reply With Quote #8

Alright, I'll wait for the respond.
zmd94 is offline
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 12-11-2014 , 10:59   Re: Problem wyth respawn plugin
Reply With Quote #9

Quote:
Originally Posted by zmd94 View Post
Alright, I'll wait for the respond.
PHP Code:
public Ham_Killed_Post(victimattackershouldgib)
{
    if(
is_user_alive(victim) && is_user_zombie(victim))
    {
        
set_task(get_pcvar_float(g_iTime), "iCount"victim+TASK_RESPAWN__"b")
    }


PHP Code:
public Ham_Killed_Post(victimattackershouldgib)
{
    if(!
is_user_alive(victim) && is_user_zombie(victim))
    {
        
set_task(get_pcvar_float(g_iTime), "iCount"victim+TASK_RESPAWN__"b")
    }

And hud appears when I'm respawned,but should appears while waiting for cooldown.
I'll give you an example (one problem wyth old respawn plugin):
I'm zombie and I die.Wait for cooldown to respawn me.But round end,and my respawn cooldown is end and I'm respawned but like a human in TS.I do not know if this is going to happen with your version.
Krtola is offline
Send a message via Skype™ to Krtola
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 12-11-2014 , 11:44   Re: Problem wyth respawn plugin
Reply With Quote #10

So, you have fixed the problem with the hud message?
zmd94 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 15:23.


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