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

helpz me blisz


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Markiez
Junior Member
Join Date: Mar 2018
Location: somewhere over the rainb
Old 05-14-2018 , 12:55   helpz me blisz
Reply With Quote #1

Code:
#pragma semicolon 1

#include <sourcemod>
#include <cstrike>
#include <sdktools>

#pragma newdecls required

public void OnPluginStart()
{
	HookEvent("player_spawn", Event_Spawn);
}

public Action Event_Spawn(Event event, const char[] name, bool dontBroadcast)
{
	if (GetTeamClientCount(CS_TEAM_CT) == 5 && GetTeamClientCount(CS_TEAM_T) == 5)
	{
		Kniferoundcykablyat();
	}
}
is this the way to go when I want a kniferound to start when there's five players in each teams?
or can I do it any other way.
__________________
bool am_I_retarded = true;
Markiez is offline
LenHard
Senior Member
Join Date: Jan 2016
Old 05-15-2018 , 04:17   Re: helpz me blisz
Reply With Quote #2

PHP Code:
#include <sourcemod>

#pragma semicolon 1
#pragma newdecls required

public void OnPluginStart()
{
    
HookEvent("player_team"Event_PlayerTeamEventHookMode_Post);
}

public 
void Event_PlayerTeam(Event hEventchar[] sEventNamebool bDontBroadcast)
{
    
int iTeam1 0iTeam2 0;
    
    for (
int i 0<= MaxClients; ++i)
    {
        if (
IsClientInGame(i))
        {
            switch (
GetClientTeam(i))
            {
                case 
2: ++iTeam1// Terrorist or Red Team 
                
case 3: ++iTeam2// Counter-Terrorist or Blue Team
            
}
        }
    }
    
    if (
iTeam1 == && iTeam2 == 5)
    {
        
// Knife Code...
    
}

I'm assuming this is what you want? It could be done multiple ways, this is one of them.
__________________
LenHard is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 05-15-2018 , 06:30   Re: helpz me blisz
Reply With Quote #3

Quote:
Originally Posted by LenHard View Post
PHP Code:
#include <sourcemod>

#pragma semicolon 1
#pragma newdecls required

public void OnPluginStart()
{
    
HookEvent("player_team"Event_PlayerTeamEventHookMode_Post);
}

public 
void Event_PlayerTeam(Event hEventchar[] sEventNamebool bDontBroadcast)
{
    
int iTeam1 0iTeam2 0;
    
    for (
int i 0<= MaxClients; ++i)
    {
        if (
IsClientInGame(i))
        {
            switch (
GetClientTeam(i))
            {
                case 
2: ++iTeam1// Terrorist or Red Team 
                
case 3: ++iTeam2// Counter-Terrorist or Blue Team
            
}
        }
    }
    
    if (
iTeam1 == && iTeam2 == 5)
    {
        
// Knife Code...
    
}

I'm assuming this is what you want? It could be done multiple ways, this is one of them.
Rather than using all that code above to get the client count in each team, why not just do the following with GetTeamClientCount()?

PHP Code:
#include <sourcemod>
#pragma semicolon 1
#pragma newdecls required

public void OnPluginStart()
{
    
HookEvent("player_team"Event_PlayerTeamEventHookMode_Post);
}

public 
void Event_PlayerTeam(Event event, const char[] namebool dontBroadcast
{
    
int iTeam1 2;
    
int iTeam2 3;
    if (
GetTeamClientCount(iTeam1) >= 10 && GetTeamClientCount(iTeam2) >= 10)
    {
        
// Lemme shank ya! :O
    
}

Also, I think this should be moved to the Scripting board.
__________________

Last edited by Psyk0tik; 05-15-2018 at 19:06.
Psyk0tik is offline
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 05-15-2018 , 10:43   Re: helpz me blisz
Reply With Quote #4

"Plugin/Gameplay Ideas and Requests" section is for requests, not for Scripting help. Scripting help to be assisted with current existing code goes into Scripting.

a) Please pay more attention to whee you post things in the future.

b) Please use more descriptive titles, I suggest you change the current one, so it is also consistent with the rules:

Quote:
Originally Posted by AlliedModders Rules
Use descriptive topic titles. People should know at a glance of the title what the thread is about.
__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread].

Last edited by DarkDeviL; 05-15-2018 at 10:44.
DarkDeviL is offline
Reply


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 18:49.


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