Raised This Month: $2 Target: $400


Post New Thread Reply   
Thread Tools Display Modes
Author Message
New Member
Join Date: Jun 2020
Old 06-08-2020 , 01:16   CaptainSteamAuthSystem
Reply With Quote #1

Hi, everybody

I wanna create CaptainSystem on my csgo server for knife rounds. So on the internet I found the following code:
public int RandomCaptainCT()
	int PlayersCT[MAXPLAYERS + 1];
	int PlayersCountCT;
	for (int i = 1; i <= MaxClients; i++)
		if (IsClientValid(i))
			if (GetClientTeam(i) == CS_TEAM_CT)
				PlayersCT[PlayersCountCT++] = i;
	return PlayersCT[GetRandomInt(0, PlayersCountCT - 1)];

public int RandomCaptainT()
	int PlayersT[MAXPLAYERS + 1];
	int PlayersCountT;
	for (int i = 1; i <= MaxClients; i++)
		if (IsClientValid(i))
			if (GetClientTeam(i) == CS_TEAM_T)
				PlayersT[PlayersCountT++] = i;
	return PlayersT[GetRandomInt(0, PlayersCountT - 1)];

public Action GetCaptainCT(client, args)
	CaptainCT = RandomCaptainCT();
	GetClientName(CaptainCT, CaptainName_CT, 32);
	GetClientAuthId(CaptainCT, AuthId_Steam2, CaptainID_CT, 32, false);
	PrintToChatAll("[\x07SMP\x01] \x06CT's Captain: \x04%s", CaptainName_CT);

public Action GetCaptainT(client, args)
	CaptainT = RandomCaptainT();
	GetClientName(CaptainT, CaptainName_T, 32);
	GetClientAuthId(CaptainT, AuthId_Steam2, CaptainID_T, 32, false);
	CaptainsSelected = true;
	PrintToChatAll("[\x07SMP\x01] \x06T's Captain: \x04%s", CaptainName_T);
It is choosing random captain. It's cool but i have created my server for team vs team praccs.
I need CVars for choose 2 captains of both teams.
I've not seen anything on this thread on the internet.
How can I get it?

Last edited by Kupio; 06-08-2020 at 01:28.
Kupio is offline

Thread Tools
Display Modes

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 07:33.

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