Raised This Month: $32 Target: $400
 8% 

Round End If One Player Left


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
renegade924
Junior Member
Join Date: Mar 2018
Old 03-13-2018 , 14:06   Round End If One Player Left
Reply With Quote #1

i need one plugin who check if one players left(no matters the team) to end the round and play "terrorists win" message
i have the scheme but idk how to make this work
PHP Code:
if(numberplayer ==
{
roundtime -0
sv_restart 1
;
roundtime 10}
else
plugin continue 
Ty in advance.

Last edited by renegade924; 03-13-2018 at 14:10.
renegade924 is offline
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 03-13-2018 , 15:25   Re: Round End If One Player Left
Reply With Quote #2

you need to check if any player left? then use this:
Code:
public client_disconneted(id) { //function is triggered when the player left the server. }
__________________
retired chump
DjSoftero is offline
renegade924
Junior Member
Join Date: Mar 2018
Old 03-13-2018 , 15:26   Re: Round End If One Player Left
Reply With Quote #3

I need the full code, not only this function..the description say it all.

Last edited by renegade924; 03-13-2018 at 15:26.
renegade924 is offline
D3XT3R
AlliedModders Donor
Join Date: Nov 2016
Location: Lithuania, Bomb A (Kauna
Old 03-13-2018 , 17:15   Re: Round End If One Player Left
Reply With Quote #4

PHP Code:
#include <amxmodx>
#include <engine> // engine module ONLY NEEDED for AMXX version < 1.75
#include <fakemeta>
#include <cstrike>
#include <amxmisc> // this is not a module!

// plugin's main information
#define PLUGIN_NAME "Force Team Win"
#define PLUGIN_VERSION "0.1"
#define PLUGIN_AUTHOR "VEN"

// command access level
#define CDM_ACCESS_LEVEL ADMIN_SLAY

// "fc" stands for "fake client"
new g_fc_net_name[] = "fake_client"
new g_fc_dmg_ent[] = "trigger_hurt"
new g_fc_killer[] = "fc_killer"
new g_fc_dmg_val[] = "1000.0"
new g_fc_dmg_type[] = "0"

new g_flags_ae[] = "ae"
new g_team_t[] = "TERRORIST"
new g_team_ct[] = "CT"

new g_ipsz_dmg_ent
new g_msgid_text
new g_msgid_death

new bool:g_round_over

public plugin_init() {
    
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR)
    
    
register_event("HLTV""event_new_round""a""1=0""2=0")

    
g_ipsz_dmg_ent engfunc(EngFunc_AllocStringg_fc_dmg_ent)
    
g_msgid_text get_user_msgid("TextMsg")
    
g_msgid_death get_user_msgid("DeathMsg")
}

public 
event_new_round() {
    
g_round_over false
}

public 
client_disconneted(id)
{    
    
team_loose(cs_get_user_team(id) == CS_TEAM_CT// force opposite team to loose
}

public 
team_loose(CsTeams:team) {
    if (
g_round_over || team == CS_TEAM_T)
        return 
0
    
    
// get all alive players in the team
    
new player[32], numplayer2[32], num2
    get_players
(playernumg_flags_aeteam == CS_TEAM_T g_team_t g_team_ct)
    
get_players(player2num2g_flags_aeteam == CS_TEAM_CT g_team_t g_team_ct)
    if (!
num || !num2// no alive players in team(s)
        
return 0
    
    
// create a fake client
    
new id engfunc(EngFunc_CreateFakeClientg_fc_net_name)
    if (!
id// if fake client not created (probably server is full)
        
return 0
    
    
// transfer players to temp team
    
for (new 0num; ++i)
        
cs_set_user_team(player[i], CS_TEAM_SPECTATOR)
    
    
// hide text like "fake_client connected", et cetera
    
set_msg_block(g_msgid_textBLOCK_SET)
    
dllfunc(DLLFunc_ClientPutInServerid// put fc in the server
    
    
cs_set_user_team(idteam// set it's team
    
cs_user_spawn(id// spawn fc
    
    // move fc outside map (to hide dead sound/body, etc)
    
engfunc(EngFunc_SetOriginidFloat:{8191.08191.08191.0})
    
    
set_msg_block(g_msgid_textBLOCK_NOT// unset the text block
    
set_msg_block(g_msgid_deathBLOCK_ONCE// hide fc's death
    
fc_fakedamage(id// kill fc by dealing a fake damage
    
    
set_msg_block(g_msgid_textBLOCK_SET// set the text block
    
server_cmd("kick #%d"get_user_userid(id)) // kick fc
    
server_exec() // force kick immediately
    
set_msg_block(g_msgid_textBLOCK_NOT// unset the text block
    
    // set players' team back
    
for (new 0num; ++i)
        
cs_set_user_team(player[i], team)
    
    return 
1
}

fc_fakedamage(id) {
    new 
entity engfunc(EngFunc_CreateNamedEntityg_ipsz_dmg_ent)
    if (!
entity)
        return 
0
    
    set_dmg_ent_kvd
(entity"dmg"g_fc_dmg_val)
    
set_dmg_ent_kvd(entity"damagetype"g_fc_dmg_type)
    
set_dmg_ent_kvd(entity"origin""8191 8191 8191")
    
    
dllfunc(DLLFunc_Spawnentity)
    
set_pev(entitypev_classnameg_fc_killer)
    
dllfunc(DLLFunc_Touchentityid)
    
engfunc(EngFunc_RemoveEntityentity)
    
    return 
1
}

set_dmg_ent_kvd(entitykey[], value[]) {
    
set_kvd(0KV_ClassNameg_fc_dmg_ent)
    
set_kvd(0KV_KeyNamekey)
    
set_kvd(0KV_Valuevalue)
    
set_kvd(0KV_fHandled0)
    
    return 
dllfunc(DLLFunc_KeyValueentity0)

__________________

Last edited by D3XT3R; 03-15-2018 at 06:24.
D3XT3R is offline
Send a message via Skype™ to D3XT3R
renegade924
Junior Member
Join Date: Mar 2018
Old 03-14-2018 , 06:07   Re: Round End If One Player Left
Reply With Quote #5

It's not what i need. Anyone?
renegade924 is offline
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Chandigarh, India
Old 03-14-2018 , 08:06   Re: Round End If One Player Left
Reply With Quote #6

You just want .. that if anyone ( seriously Anyone ?) Leaves the Game .. round should end up with Terrorist Win ?
instinctpt1 is offline
ish12321
Veteran Member
Join Date: May 2016
Old 03-14-2018 , 17:18   Re: Round End If One Player Left
Reply With Quote #7

Quote:
Originally Posted by instinctpt1 View Post
You just want .. that if anyone ( seriously Anyone ?) Leaves the Game .. round should end up with Terrorist Win ?
He means that if all left and only a single.player left then it should end up with terrorists win
__________________
['O|s|G'] | Death Wins a.k.a Ish Chhabra was here

Last edited by ish12321; 03-14-2018 at 17:18.
ish12321 is offline
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Chandigarh, India
Old 03-15-2018 , 00:43   Re: Round End If One Player Left
Reply With Quote #8

I don't know how to trigger a Specific Win
But i guess by slaying other Team is a good logic to trigger the Win
PHP Code:
#include <amxmodx>

public plugin_init()
{
    
register_plugin("Force Terrorist Win""1.0""DiGiTaL")    
}

public 
client_disconnected(id)
{
    
force_twin()
}

public 
force_twin()
{
    new 
players[32], numx;
    
get_players(playersnum"ae""CT");

    for(new 
0;i<num;i++)
    {
        
players[i];
        
user_silentkill(x);
    }

instinctpt1 is offline
ish12321
Veteran Member
Join Date: May 2016
Old 03-15-2018 , 03:47   Re: Round End If One Player Left
Reply With Quote #9

Quote:
Originally Posted by instinctpt1 View Post
I don't know how to trigger a Specific Win
But i guess by slaying other Team is a good logic to trigger the Win
PHP Code:
#include <amxmodx>

public plugin_init()
{
    
register_plugin("Force Terrorist Win""1.0""DiGiTaL")    
}

public 
client_disconnected(id)
{
    
force_twin()
}

public 
force_twin()
{
    new 
players[32], numx;
    
get_players(playersnum"ae""CT");

    for(new 
0;i<num;i++)
    {
        
players[i];
        
user_silentkill(x);
    }

That'll decrease their frags and increase deaths both by 1
__________________
['O|s|G'] | Death Wins a.k.a Ish Chhabra was here
ish12321 is offline
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Chandigarh, India
Old 03-15-2018 , 04:38   Re: Round End If One Player Left
Reply With Quote #10

Well you can then set the death to -1 by using CSTRIKE
instinctpt1 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 05:59.


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