AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Remaining CT = slay (https://forums.alliedmods.net/showthread.php?t=324653)

Stefanos 05-22-2020 18:31

Remaining CT = slay
 
I Need plugin that will only work if server has 3 players(no counting bots,if counting bots 5 players)

When CT Stay ALONE vs TR, hud message is shown on screen RGB "000,000,255"
CT Slaying in: #seconds, when time ends, remaining CT Player get slayed.

Bugsy 05-22-2020 20:00

Re: Remaining CT = slay
 
So if no bots are on the server:
1 CT, 2 T

Bots on server:
1 CT, 4 T

?

How many seconds for the HUD before slay occurs?

What happens if a player connects during count down?

Bugsy 05-22-2020 20:44

Re: Remaining CT = slay
 
PHP Code:


#include <amxmodx>

new const Version[] = "0.5";

new 
g_pSlayNoBots g_pSlayWithBots g_pSlayDelay g_pPluginStartDelay;
new 
g_Bots g_iSeconds g_iSlayID;
new 
g_szName33 ] , g_shHUD g_iRoundStartTime;

public 
plugin_init() 
{
    
register_plugin"Slay CT" Version "bugsy" );

    
register_event"HLTV" "NewRound" "a" "1=0" "2=0" );
    
register_logevent"RoundEnd" "1=Round_End" );
    
    
g_pSlayNoBots register_cvar"sct_nobotslay" "3" );
    
g_pSlayWithBots register_cvar"sct_botslay" "5" );
    
g_pSlayDelay register_cvar"sct_slaydelay" "5" );
    
g_pPluginStartDelay register_cvar"sct_rounddelayseconds" "90" );
    
    
g_shHUD CreateHudSyncObj();
    
    
set_task1.0 "SlayCheck" 139457 , .flags="b" );
}

public 
client_putinserverid )
{
    
g_Bots |= ( is_user_botid ) << ( id 31 ) );
}

public 
client_disconnectid )
{
    
g_Bots &= ~( << ( id 31 ) );
    
    if ( 
id == g_iSlayID )
        
remove_taskg_iSlayID );
}

public 
NewRound()
{
    
g_iRoundStartTime get_systime();
}

public 
RoundEnd()
{
    
remove_taskg_iSlayID );
}

public 
SlayCheck()
{
    new 
iPlayers32 ] , iNum;
    
    if ( !
g_iSlayID && ( get_systime() - g_iRoundStartTime ) >= get_pcvar_numg_pPluginStartDelay ) && ( get_playersnum() > get_pcvar_numg_Bots g_pSlayWithBots g_pSlayNoBots ) ) )
    {
        
get_playersiPlayers iNum "ae" "CT" );
        
        if ( 
iNum == )
        {
            
set_task1.0 "DisplayHUD" , ( g_iSlayID iPlayers] ) , .flags="a" , .repeat=( g_iSeconds get_pcvar_numg_pSlayDelay ) + )  );
        }
    }
}

public 
DisplayHUDid )
{
    if ( 
g_szName] == EOS )
        
get_user_nameid g_szName charsmaxg_szName ) );
    
    if ( --
g_iSeconds >= 
    {
        
set_hudmessage170 255 , -1.0 0.40 0.0 1.0 0.0 0.0 , -);
        
ShowSyncHudMsgg_shHUD "%s will be slayed in %d second%s!" g_szName g_iSeconds g_iSeconds "s" "" );
    }
    else
    {
        
user_killid );
        
g_iSlayID 0;
        
g_szName] = EOS;
    }



Stefanos 05-23-2020 11:09

Re: Remaining CT = slay
 
Okay bugsy, i didn't typed how i should.. when server has MORE than 3 players(or more than 5 players if bots are counted) last CT player will get slayed in 30 seconds... sorry i was typing that late..

Bugsy 05-23-2020 11:37

Re: Remaining CT = slay
 
Above code is updated.

Stefanos 05-23-2020 14:44

Re: Remaining CT = slay
 
It was 24ct vs 1 tr, i was last ct, and when i was remaining CT there was no HUD + i waited 1min and no slay :/

Bugsy 05-23-2020 14:46

Re: Remaining CT = slay
 
You told me player count has to be > 3 or 5. Based on what you just said, if it's 1 tr vs 1 remaining ct, it will not work.

Bugsy 05-23-2020 14:49

Re: Remaining CT = slay
 
Assuming player count means ALIVE player count..

Stefanos 05-23-2020 14:53

Re: Remaining CT = slay
 
yes my bad.. PLUGIN WILL WORK ONLY IF THERE IS MORE THAN 3 PLAYERS ON SERVER!!!(5 if counting bots)
BUT.. Plugin will slay only LAST ALIVE CT player !
so if is there 25 ct players and 1 remaining, hud is activated and player will be slayed in 30s :)

Bugsy 05-23-2020 14:54

Re: Remaining CT = slay
 
Ok, so player count should include dead and alive?

Stefanos 05-23-2020 14:59

Re: Remaining CT = slay
 
yes for example:
1.Terrorist Team:
Nicolas
2.CT Team:
Bugsy
Stefanos

You die, and im left alone. plugin THERES START TO WORK! (why? bcs if i want to troll srw i wont die until the end of round, that means sometimes when i dont have admins 1 guy will troll 25 players and all will quit server, bcs they cant play bcs some idiot trolls them)

case #2:
TR Team:
Nicolas:
CT Team:
Bugsy

there is 2 players PLUGIN SHOULD NOT WORK NOW, bcs you will get slayed 30sec from roundstart,

*Warning(Always 2 bots in spec)

i hope u understand, sorry for confusing & bad eng.

Bugsy 05-23-2020 15:02

Re: Remaining CT = slay
 
My question is, does the player count (3 no bots, 5 if bots) include ALL or ONLY ALIVE?

Stefanos 05-23-2020 15:03

Re: Remaining CT = slay
 
all !

Bugsy 05-23-2020 15:07

Re: Remaining CT = slay
 
Ok, above code is updated. You need to provide complete details when requesting a plugin.

Stefanos 05-23-2020 15:19

Re: Remaining CT = slay
 
now my player die withour reason o.o even if they are not last CT in team

Bugsy 05-23-2020 15:21

Re: Remaining CT = slay
 
Conditions for HUD and slay to happen:

Total connected players if no bots > 3
OR
Total connected players if bots > 5

AND

1 remaining CT is alive

Stefanos 05-23-2020 15:25

Re: Remaining CT = slay
 
Player should be slayed if he is reamining ct alive, but should not be slayed if sever has less than 3 players(5 counting bots)

Bugsy 05-23-2020 15:58

Re: Remaining CT = slay
 
yes the code should work as is

Stefanos 05-23-2020 16:00

Re: Remaining CT = slay
 
players get slayed without reason.

Bugsy 05-23-2020 16:02

Re: Remaining CT = slay
 
I just tested it

10 players total, me and 9 bots.

I am on CT team, I slayed all of the CT's leaving it at 1 CT 5 T's, and my HUD began showing.

Stefanos 05-23-2020 16:10

Re: Remaining CT = slay
 
Tested again, hud was shown, did not get slayed, can you set hud to be little more light blue, and its blinking, can it be set to stay with effect 1 i guess?, and can you add that all players see that message

Stefanos 05-23-2020 16:13

Re: Remaining CT = slay
 
slay works but not for people that have immunity, fix that

Bugsy 05-23-2020 16:15

Re: Remaining CT = slay
 
The problem with the slay not happening is likely due to the player having immunity.

"Client "bugsy" has immunity"

Code updated to lighten the blue color, show player name in HUD and show to everyone.

Bugsy 05-23-2020 16:27

Re: Remaining CT = slay
 
Above code updated to not obey immunity

Bugsy 05-23-2020 16:39

Re: Remaining CT = slay
 
Fixed the HUD to show the seconds correctly.

Stefanos 05-23-2020 17:16

Re: Remaining CT = slay
 
Hud still blinking, and pls do if round ends hud will dissapear, it stays after round if player die before slay :)

Bugsy 05-23-2020 17:23

Re: Remaining CT = slay
 
Above code updated to handle round end. I made a slight tweak for the blinking, but it's hard to get it perfect since you are showing a HUD with a given duration every X seconds.

DJEarthQuake 05-23-2020 17:58

Re: Remaining CT = slay
 
This should take care of those with immunity if user_kill won't do it.
Code:
///user_kill( id ); fakedamage(id,"Last man standing. Oblivious to objective.",100.0,DMG_TIMEBASED);

Stefanos 05-23-2020 17:58

Re: Remaining CT = slay
 
works perfect, just hud now everyseconds dissapear and comes again, im sure there is a fix for that im using 3 plugins like countdown on hud and no problem...

Bugsy 05-23-2020 17:59

Re: Remaining CT = slay
 
You can try tweaking this, increment 0.1 at a time. This is the duration that the HUD displays each time.

set_hudmessage( 0 , 170 , 255 , -1.0 , 0.40 , 0 , 0.0 , 1.0 , 0.0 , 0.0 , -1 );

Bugsy 05-23-2020 18:00

Re: Remaining CT = slay
 
Quote:

Originally Posted by DJEarthQuake (Post 2701900)
This should take care of those with immunity if user_kill won't do it.
Code:
///user_kill( id ); fakedamage(id,"Last man standing. Oblivious to objective.",100.0,DMG_TIMEBASED);

user_kill() will handle it, I previously had it using the amx_slay command.

Stefanos 05-23-2020 21:16

Re: Remaining CT = slay
 
can you do this "Slay time wont start if round didnt last at least 91 seconds"
so after new round it needs to take 91 seconds to start plugin, i hope u understand

Bugsy 05-23-2020 21:22

Re: Remaining CT = slay
 
Code updated, new cvar sct_rounddelayseconds

Stefanos 05-23-2020 21:37

Re: Remaining CT = slay
 
dont want to open another thread to spam.. can you do this(different plugin)

When TR get GUN(no grenades), only pistols,rifles,sniper,etc... they automaticly get removed from them.

Bugsy 05-23-2020 21:43

Re: Remaining CT = slay
 
PHP Code:


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

new const Version[] = "0.2";

#define MAX_PLAYERS 32

new const ALLOW_WEAPONS = ( << CSW_KNIFE ) | ( << CSW_DEAGLE ) | ( << CSW_FLASHBANG ) | ( << CSW_SMOKEGRENADE ) | ( << CSW_HEGRENADE );

public 
plugin_init() 
{
    
register_plugin"Block Weapons" Version "bugsy" );
    
    
RegisterHamHam_AddPlayerItem "player" "AddPlayerItem" );
}

public 
AddPlayerItemid iItemEntity )
{
    if ( ( 
cs_get_user_teamid ) == CS_TEAM_T ) && !( ALLOW_WEAPONS & ( << cs_get_weapon_idiItemEntity ) ) ) )    
    {
        
set_peviItemEntity pev_flags FL_KILLME );
        
SetHamReturnIntegerfalse );
        return 
HAM_SUPERCEDE
    }
    
    return 
HAM_IGNORED



Stefanos 05-23-2020 21:43

Re: Remaining CT = slay
 
Quote:

Originally Posted by Bugsy (Post 2701937)
Code updated, new cvar sct_rounddelayseconds

now there is no hud or slay.. i was only alive and 90+ seconds passed. nothing happens

Bugsy 05-23-2020 21:44

Re: Remaining CT = slay
 
A death has to happen after 90 seconds has passed, this triggers it.

Stefanos 05-23-2020 21:50

Re: Remaining CT = slay
 
Slay countdown should only be available if 90 seconds passes, but after 90+ seconds i was only left alive, and there was no countdown

Bugsy 05-23-2020 21:52

Re: Remaining CT = slay
 
I just told you, the HUD and slay is triggered when a player dies. So it has to be 90 seconds into a round AND a death has to happen. I've already made a bunch of updates for you and you keep changing what you want.

Stefanos 05-23-2020 21:53

Re: Remaining CT = slay
 
Quote:

Originally Posted by Bugsy (Post 2701940)
PHP Code:


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

new const Version[] = "0.1";

#define MAX_PLAYERS 32

new const ALLOW_WEAPONS = ( << CSW_FLASHBANG ) | ( << CSW_SMOKEGRENADE ) | ( << CSW_HEGRENADE );

public 
plugin_init() 
{
    
register_plugin"Block Weapons" Version "bugsy" );
    
    
RegisterHamHam_AddPlayerItem "player" "AddPlayerItem" );
}

public 
AddPlayerItemid iItemEntity )
{
    if ( !( 
ALLOW_WEAPONS & ( << cs_get_weapon_idiItemEntity ) ) ) )    
    {
        
set_peviItemEntity pev_flags FL_KILLME );
        
SetHamReturnIntegerfalse );
        return 
HAM_SUPERCEDE
    }
    
    return 
HAM_IGNORED



Add knife to allowed wepaons, and CT's now dont have anything xd.. should be only for TR


All times are GMT -4. The time now is 11:34.

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