Raised This Month: $ Target: $400
 0% 

Giving award for all players in team problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kubad
Senior Member
Join Date: Sep 2015
Location: Czech Republic
Old 04-30-2016 , 13:22   Giving award for all players in team problem
Reply With Quote #1

Hello guys i have problem with reward for win team i tried this this dont working all time

PHP Code:

public Action:roundEnd(Handle:event, const String:name[], bool:dontBroadcast
{

    
int winner GetEventInt(event"winner");
    if(
winner == CS_TEAM_CT)
    {
        
RoundWIN 3;
        
WINTEAMCredits();
    }else if(
winner == CS_TEAM_T){
        
RoundWIN 2;
        
WINTEAMCredits();
    }
}

public 
Action:WINTEAMCredits()
{
    for (new 
1<= MaxClientsi++)
    {
        if (!
IsClientInGame(i))
        {
            continue;
        }
        
        if(
GetClientTeam(i) == TEAM_CT && RoundWIN == 3)
        {
            if (
IsClientInGame(i))
            
g_iCredits[i] += CheckCommandAccess(i""ADMFLAG_CUSTOM1true) ? GetConVarInt(g_CvarGetVIPCreditWIN) : GetConVarInt(g_CvarGetCreditWIN);
        }
        else if(
GetClientTeam(i) == TEAM_T && RoundWIN == 2)
        {
            if (
IsClientInGame(i))
            
g_iCredits[i] += CheckCommandAccess(i""ADMFLAG_CUSTOM1true) ? GetConVarInt(g_CvarGetVIPCreditWIN) : GetConVarInt(g_CvarGetCreditWIN);

        }
    }

Kubad is offline
ESK0
BANNED
Join Date: May 2014
Location: Czech Republic
Old 04-30-2016 , 14:05   Re: Giving award for all players in team problem
Reply With Quote #2

Sup Kubad..

Code:
public Action roundEnd(Event event, const char[] name, bool dontBroadcast)
{
	int winner = event.GetInt("winner");
	for(int i = 1; i <= MaxClients; i++)
	{
		if(IsClientInGame(i))
		{
			if(GetClientTeam(i) == winner)
			{
				g_iCredits[i] += CheckCommandAccess(i, "", ADMFLAG_CUSTOM1, true) ? GetConVarInt(g_CvarGetVIPCreditWIN) : GetConVarInt(g_CvarGetCreditWIN);
			}
		}
	}
}
or
Code:
public Action roundEnd(Event event, const char[] name, bool dontBroadcast)
{
	int winner = event.GetInt("winner");
	WINTEAMCreadits(winner);
}
public void WINTEAMCreadits(int team)
{
	for(int i = 1; i <= MaxClients; i++)
	{
		if(IsClientInGame(i))
		{
			if(GetClientTeam(i) == team)
			{
				g_iCredits[i] += CheckCommandAccess(i, "", ADMFLAG_CUSTOM1, true) ? GetConVarInt(g_CvarGetVIPCreditWIN) : GetConVarInt(g_CvarGetCreditWIN);
			}
		}
	}
}
ESK0 is offline
Kubad
Senior Member
Join Date: Sep 2015
Location: Czech Republic
Old 05-01-2016 , 11:51   Re: Giving award for all players in team problem
Reply With Quote #3

Quote:
Originally Posted by ESK0 View Post
Sup Kubad..

Code:
public Action roundEnd(Event event, const char[] name, bool dontBroadcast)
{
	int winner = event.GetInt("winner");
	for(int i = 1; i <= MaxClients; i++)
	{
		if(IsClientInGame(i))
		{
			if(GetClientTeam(i) == winner)
			{
				g_iCredits[i] += CheckCommandAccess(i, "", ADMFLAG_CUSTOM1, true) ? GetConVarInt(g_CvarGetVIPCreditWIN) : GetConVarInt(g_CvarGetCreditWIN);
			}
		}
	}
}
or
Code:
public Action roundEnd(Event event, const char[] name, bool dontBroadcast)
{
	int winner = event.GetInt("winner");
	WINTEAMCreadits(winner);
}
public void WINTEAMCreadits(int team)
{
	for(int i = 1; i <= MaxClients; i++)
	{
		if(IsClientInGame(i))
		{
			if(GetClientTeam(i) == team)
			{
				g_iCredits[i] += CheckCommandAccess(i, "", ADMFLAG_CUSTOM1, true) ? GetConVarInt(g_CvarGetVIPCreditWIN) : GetConVarInt(g_CvarGetCreditWIN);
			}
		}
	}
}
i tried 2 metod and working Thanks
Kubad is offline
ESK0
BANNED
Join Date: May 2014
Location: Czech Republic
Old 05-01-2016 , 18:51   Re: Giving award for all players in team problem
Reply With Quote #4

You are welcome
ESK0 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 04:27.


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