Raised This Month: $ Target: $400
 0% 

Check if player is in winning or losing team


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
charrer
Junior Member
Join Date: Mar 2012
Old 05-02-2012 , 03:34   Check if player is in winning or losing team
Reply With Quote #1

Hey, im trying to create a plugin that checks if player is in winning or in losing team when round ends. So far i found some snippets from other threads and got to this:
Code:
HookEvent("teamplay_round_win", Event_RoundWin);
Code:
public Action:Event_RoundWin(Handle:event, const String:name[], bool:dontBroadcast) 
{ 
    new team; 
    new winteam = GetEventInt(event, "winning_team"); 
     
    for(new i=1; i<=MaxClients; i++) 
    { 
        if (IsClientInGame(i)) 
        { 
            // Spectator or other 
            if ((team = GetClientTeam(i)) <= 1) 
                continue; 
             
            if (team == winteam) 
            { 
                // win team 
				
            } 
            else 
            { 
                // lost team 
            } 
        } 
    } 
}
Now i need to find out if client is in winning or losing team, and store it in a variable so i can use it in if-statement in PlayerSpawn event. I bet this is a simple thing, but i just cant figure out how to do it without creating like hundreds of variables, one for each possible client

So for example: I want to find out if client is in winning team or in losing team, and print text to each client individually. Or give hp/armor according to it, or weapons.

Also i just noticed that teamplay_round_win is not valid event in CSS, any idea how to fix this aswell?
Do i have to hook all possible events that cause round win/lose, such as bomb_exploded, bomb_defused etc?

Last edited by charrer; 05-02-2012 at 04:07.
charrer is offline
 



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 13:44.


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