AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Respawn (https://forums.alliedmods.net/showthread.php?t=173518)

Choose_Your_Destiny 12-06-2011 10:56

Respawn
 
I have a deahrun sw. Players entering the game later is dead.

I need plugin.players entering the game immediately spawn again

Napoleon_be 12-06-2011 11:10

Re: Respawn
 
PHP Code:

#include <amxmodx>
#include <hamsandwich>
#include <cstrike>

#define VERSION "1.0"

new Float:tasktime[33] = 3.0

public plugin_init() {
    
register_plugin("Respawn"VERSION"NapoleoN#")
}

public 
client_putinserver(id) {
    
set_task(tasktime[id], "CheckRespawn"id)
}

public 
CheckRespawn(iPlayer) {
    if(
cs_get_user_team(iPlayer) != CS_TEAM_UNASSIGNED || cs_get_user_team(iPlayer) != CS_TEAM_SPECTATOR) {
        
ExecuteHamB(Ham_CS_RoundRespawniPlayer)
    } else {
        return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_HANDLED


Untested but it should work.
If any bugs, please tell me.

ConnorMcLeod 12-07-2011 01:14

Re: Respawn
 
Napoleon plugin won't work.

PHP Code:

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define VERSION "0.0.1"
#define PLUGIN "Late Join Respawn"

#define XO_PLAYER                    5
#define m_iMenuCode                205

#define Menu_ChooseAppearance    3
#define cs_get_user_menu(%0)    get_pdata_int(%0, m_iMenuCode, XO_PLAYER)

new g_bitRespawnQueue
#define put_user_in_respawn_queue(%0)                    g_bitRespawnQueue |= 1<<(%0&31)
#define is_user_in_respawn_queue(%0)                    g_bitRespawnQueue & 1<<(%0&31)
#define remove_user_from_respawn_queue(%0)        g_bitRespawnQueue &= ~(1<<(%0&31))

public plugin_init()
{
    
register_plugin(PLUGINVERSION"ConnorMcLeod")

    
register_clcmd("joinclass""ClCmd_CoudBeChoosingAppearance")
    
register_clcmd("menuselect""ClCmd_CoudBeChoosingAppearance")
}

public 
client_putinserverid )
{
    
put_user_in_respawn_queueid )
}

public 
ClCmd_CoudBeChoosingAppearanceid )
{
    if( 
is_user_in_respawn_queue(id) && cs_get_user_menu(id) == Menu_ChooseAppearance )
    {
        
remove_user_from_respawn_queueid )
        
set_task(0.1"Respawn_User"id)
    }
}

public 
Respawn_Userid )
{
    if( !
is_user_alive(id) && is_user_connected(id) )
    {
        
ExecuteHamB(Ham_CS_RoundRespawnid)
    }




All times are GMT -4. The time now is 20:58.

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