Raised This Month: $ Target: $400
 0% 

Respawn problem


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 


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 07:44.


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