Raised This Month: $ Target: $400
 0% 

When 1 person in the server


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hugz`
Veteran Member
Join Date: Jul 2007
Location: In a house
Old 01-04-2008 , 16:55   When 1 person in the server
Reply With Quote #1

Request: When there is 1 person in the server or only on T/CT, plugin will execute a certain console command..

Lets say there are 3 people in spec, none on T and 1 on CT, the plugin will execute.. for example "sv_restart 1"

Or if there is none in spec, none in CT, but one in T, it will execute the same command..
__________________
hugz` is offline
Send a message via AIM to hugz`
hugz`
Veteran Member
Join Date: Jul 2007
Location: In a house
Old 01-05-2008 , 13:03   Re: When 1 person in the server
Reply With Quote #2

Is it even possible?
__________________
hugz` is offline
Send a message via AIM to hugz`
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-05-2008 , 13:37   Re: When 1 person in the server
Reply With Quote #3

Yep, it is possible.
__________________
Arkshine is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-06-2008 , 12:15   Re: When 1 person in the server
Reply With Quote #4

[code removed]

not sure if this is working, but thats how i would do it

Edit: pawn tags always ruin code when i wanna edit.
gimme a minute

Edit:
Code:
#include <amxmodx>
#include <fakemeta>

new Float:g_CmdDelay;

public plugin_init()
{
	register_plugin("Plugin Name", "1.0", "Author");
	register_forward(FM_StartFrame, "fwd_StartFrame");
}

public fwd_StartFrame()
{
	static Float:gametime;
	gametime = get_gametime();
	if(gametime < g_CmdDelay)
		return FMRES_IGNORED;
	
	static players[32], ctnum, tnum, specnum;
	get_players(players, ctnum, "ae", "CT");
	get_players(players, tnum, "ae", "TERRORIST");
	get_players(players, specnum, "a");
	specnum -= (ctnum + tnum);
	if(specnum && ctnum && !tnum || !ctnum && tnum)
	{
		server_cmd("sv_restart 1");
		g_CmdDelay = gametime + 10.0;
	}
	return FMRES_IGNORED;
}
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!

Last edited by Exolent[jNr]; 01-06-2008 at 12:21.
Exolent[jNr] 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 02:12.


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