AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Anti late join (https://forums.alliedmods.net/showthread.php?t=318795)

MihailoZ 09-21-2019 06:32

Anti late join
 
Hello,

I tried using this plugin https://forums.alliedmods.net/showpo...7&postcount=29

and it has a bug where after the round is ended (last player is killed) it respawns only players who were already on server (didn't join late).

Thanks.

MihailoZ 09-21-2019 16:30

Re: Anti late join
 
Code:

/*-----------------------------------------------------------------------------------------------------------------------*/
/* Script forged in the depths of the ocean by Stewie!                                                                  */
/*---------------------------------------------------------------------------------------------------------=[ Stewie! ]=-*/
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>

#pragma semicolon 1;

/* Info */
new PLUG[] = "Anti Late Spawn";
new VERS[] = "(  .  Y  .  )";
new AUTH[] = "Stewie!";

new Float:gflDelay = 5.0;
new Float:gflRoundStart;

new giSpawns[33];

/*-----------------------------------------------------------------------------------------------------------------------*/
/* plugin_init                                                                                                          */
/*---------------------------------------------------------------------------------------------------------=[ Stewie! ]=-*/
public plugin_init()
{
    register_plugin(PLUG, VERS, AUTH);
    register_cvar(PLUG, VERS, FCVAR_SERVER);
   
    /* Forwards */
    RegisterHam(Ham_Spawn, "player", "fwdPlayerSpawn", 1);
   
    /* Events */
    register_logevent("eventRoundStart", 2, "1=Round_Start");
}

/*-----------------------------------------------------------------------------------------------------------------------*/
/* Forwards                                                                                                              */
/*---------------------------------------------------------------------------------------------------------=[ Stewie! ]=-*/
public client_connect(id)
{
    giSpawns[id] = 0;
}

public fwdPlayerSpawn(id)
{
    giSpawns[id]++;
   
    if(giSpawns[id] == 2 && get_gametime() >= (gflRoundStart + gflDelay))
        user_silentkill(id)
    return HAM_IGNORED;
}

/*-----------------------------------------------------------------------------------------------------------------------*/
/* Events                                                                                                                */
/*---------------------------------------------------------------------------------------------------------=[ Stewie! ]=-*/
public eventRoundStart()
{
    gflRoundStart = get_gametime();
}

This one is working fine. It's just has a preview of death (3rd person view every time a player joins late)


All times are GMT -4. The time now is 17:22.

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