Raised This Month: $ Target: $400
 0% 

Respawn problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Tonight
BANNED
Join Date: Apr 2012
Location: Estonia
Old 04-22-2012 , 18:38   Respawn problem
Reply With Quote #1

Hey, I have 1 little problem with my respawn plugin. Now, if all the players of one team are dead, the players respawn, but then the new round automaticly begins. I want, that there is no new round, game continues. Code is OK, just need to add that no new round part.

Code:
#include <amxmodx>
#include <fun>

#define PLUGIN "respawn"
#define VERSION "1.0"
#define AUTHOR "Tonight /A/"

public TeamSelect(id)
{
    if (get_cvar_num("amx_respawn") == 1)   {
        new sId[2]
        sId[0] = id
        set_task(10.0,"respawn",0,sId,2)
    }
    return PLUGIN_CONTINUE
}

public death_msg() 
{    
    if (get_cvar_num("amx_respawn") == 1)   { 
        new vIndex = read_data(2) 
        new svIndex[2]
        svIndex[0] = vIndex
        set_task(0.5,"respawn",0,svIndex,2) 
    } 
    return PLUGIN_CONTINUE 
} 

public respawn(svIndex[]) 
{ 
    new vIndex = svIndex[0] 
    if(get_user_team(vIndex) == 3 || is_user_alive(vIndex)) 
        return PLUGIN_CONTINUE 
    spawn(vIndex) 
    
    return PLUGIN_CONTINUE    
} 

public plugin_init() 
{ 
       register_plugin("respawn","1.0","Tonight /A/") 
    register_event("DeathMsg","death_msg","a") 
    register_event("ShowMenu","TeamSelect","b","4&Team_Select")
    register_event("VGUIMenu","TeamSelect","b","1=2")
    register_cvar("amx_respawn","1") 
    
    return PLUGIN_CONTINUE 
}

Last edited by Tonight; 04-23-2012 at 08:12.
Tonight is offline
Tonight
BANNED
Join Date: Apr 2012
Location: Estonia
Old 04-23-2012 , 12:22   Re: Respawn problem
Reply With Quote #2

UP! Need help
Tonight is offline
Bilal Pro
Senior Member
Join Date: Mar 2012
Location: Holland
Old 04-23-2012 , 12:40   Re: Respawn problem
Reply With Quote #3

Explain it better please.
__________________
  • Point System with rank titles for sale [X] [100% private]
  • VIP Menu for sale [X] [100% private]
  • HnS shop more features for sale [X] [100% private]
Contact: Bilalzaandam1234, on steam if you are interested.
Bilal Pro is offline
Tonight
BANNED
Join Date: Apr 2012
Location: Estonia
Old 04-23-2012 , 12:43   Re: Respawn problem
Reply With Quote #4

I want, that there comes no new round
Tonight is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 04-23-2012 , 12:59   Re: Respawn problem
Reply With Quote #5

Quote:
Originally Posted by Bilal Pro View Post
Explain it better please.
i figured he wanted it to be like CSDM, but waiting for all clients to be dead before respawn. Then respawn within the same round. Why? beats the hell out of me. but i couldn't figure out code to help.

psudocode:
event: all team is dead >hook> respawn
catch: event: new round >hook> check for time limit

but i don't know how to catch events before they're thrown to the world.
hope this helps. I'm also interested in the answer, so i'm gonna stay up to date on this thread.

Last edited by Liverwiz; 04-23-2012 at 13:00.
Liverwiz is offline
Tonight
BANNED
Join Date: Apr 2012
Location: Estonia
Old 04-23-2012 , 15:36   Re: Respawn problem
Reply With Quote #6

Actually..

I try to make it easy way...

1. Maybe all players of one team are dead at the same time
2. They all respawn
3. But my plugin does after respawn new round (if all the CTs/Ts are dead), so I want to delete that new round part

Plugin is correct, just need to add that no new round part

Last edited by Tonight; 04-23-2012 at 15:36.
Tonight is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 04-23-2012 , 19:58   Re: Respawn problem
Reply With Quote #7

try
Code:
register_event("Round_End", "event_rE", "a")

public event_rE()
    return plugin_continue
not sure if it will work....but its worth a try. please note....this will NEVER have the round end. untill the map is over.

Last edited by Liverwiz; 04-23-2012 at 19:59.
Liverwiz is offline
K.K.Lv
Veteran Member
Join Date: Aug 2008
Location: GameFolder
Old 04-23-2012 , 23:25   Re: Respawn problem
Reply With Quote #8

try this one
http://forums.alliedmods.net/showthread.php?t=95705
__________________
QQ:116268742
K.K.Lv is offline
Send a message via MSN to K.K.Lv
Tonight
BANNED
Join Date: Apr 2012
Location: Estonia
Old 04-24-2012 , 08:59   Re: Respawn problem
Reply With Quote #9

Liverwiz:undefined symbol "event_rE"

K.K.Lv, thank you for helping I will use this, if I can't find better solution!

ANYBODY KNOWS THE CODE ?
Tonight is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 04-24-2012 , 11:57   Re: Respawn problem
Reply With Quote #10

Quote:
Originally Posted by Tonight View Post
Liverwiz:undefined symbol "event_rE"
event_rE is a function that you must define. I wrote that function for you
Code:
 public event_rE() 
    return plugin_continue
throw that below your plugin_init()

the register_event line goes within plugin_init()
Liverwiz 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 07:44.


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