Raised This Month: $51 Target: $400
 12% 

SM version of this AMX plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AuricYoutube
Senior Member
Join Date: Aug 2016
Location: Here
Old 07-31-2018 , 08:02   SM version of this AMX plugin
Reply With Quote #1

Hello, I was wondering if someone could make a SM version of this plugin

https://forums.alliedmods.net/showthread.php?p=92792

That is compatible for csgo, it does not have to have all the cvars included, just the basic idea that the bots die when all players die
AuricYoutube is offline
Grey83
Veteran Member
Join Date: Dec 2014
Location: Ukraine
Old 08-04-2018 , 16:10   Re: SM version of this AMX plugin
Reply With Quote #2

maybe is better do it in this way?
PHP Code:
#include <cstrike>

public void OnPluginStart()
{
    
HookEvent("player_death"Event_OnPlayerDeathEventHookMode_PostNoCopy);
}

public 
void Event_OnPlayerDeath(Event event, const char[] namebool dontBroadcast)
{
    static 
int num[2], team;
    for(
1num[0] = num[1] = 0<= MaxClientsi++)
        if(
IsClientInGame(i) && !IsFakeClient(i) && (team GetClientTeam(i)) > && IsPlayerAlive(i))
        {
            
num[team 2]++;
            if(
num[0] && num[1]) return;
        }

    
CS_TerminateRound(0.1num[0] ? CSRoundEnd_TerroristWin CSRoundEnd_CTWintrue);

Attached Files
File Type: sp Get Plugin or Get Source (123.sp - 161 views - 559 Bytes)
File Type: smx 123.smx (3.9 KB, 84 views)
__________________

Last edited by Grey83; 08-04-2018 at 16:12.
Grey83 is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 08-05-2018 , 06:21   Re: SM version of this AMX plugin
Reply With Quote #3

https://forums.alliedmods.net/showthread.php?p=514798
__________________
8guawong is offline
AuricYoutube
Senior Member
Join Date: Aug 2016
Location: Here
Old 08-07-2018 , 14:05   Re: SM version of this AMX plugin
Reply With Quote #4

8guawong, the autoslay on the bot tools plugin doesn't work on csgo because sv_cheats needs to be set to 1 (because it runs bot_kill)
Grey83, if it is possible make it not ignore mp_round_restart_delay and restart instantly

nvm, i have managed to use CS_TerminateRound(GetConVarFloat(FindConVar(" mp_round_restart_delay")), CSRoundEnd_CTWin); from this thread https://forums.alliedmods.net/showthread.php?t=224568

to fix my issue thanks grey83

Last edited by AuricYoutube; 08-07-2018 at 16:43.
AuricYoutube is offline
AuricYoutube
Senior Member
Join Date: Aug 2016
Location: Here
Old 08-08-2018 , 05:59   Re: SM version of this AMX plugin
Reply With Quote #5

grey83, it seems that the round restarts no matter how many players the team has if one person dies, pls help

edit: nvm I found this on another thread, it works perfectly, but if possible can you make slaybots run CS_TerminateRound(GetConVarFloat(FindConVar(" mp_round_restart_delay")), CSRoundEnd_CTWin); instead of forceplayersuicide?

Quote:
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>

public OnPluginStart()
{
HookEvent("player_death", Event_PlayerDeath);
}

public Action:Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));

if (!IsFakeClient(client) && AllHumansDead())
{
SlayBots();
}
}

bool:AllHumansDead()
{
new bool:result = true;

for (new i = 1; i <= MaxClients; i++)
{
if (IsClientInGame(i) && !IsFakeClient(i) && IsPlayerAlive(i)) // Thanks Black-Rabbit
{
result = false;
}
}

return result;
}

SlayBots()
{
for (new i = 1; i <= MaxClients; i++)
{
if (IsClientInGame(i) && IsFakeClient(i) && IsPlayerAlive(i))
{
ForcePlayerSuicide(i);
}
}
}

Last edited by AuricYoutube; 08-08-2018 at 06:24.
AuricYoutube 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 08:12.


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