Raised This Month: $ Target: $400
 0% 

Changing Teams Help!


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
oxygen935
Veteran Member
Join Date: Jun 2012
Location: Athens, Greece
Old 04-14-2013 , 14:29   Changing Teams Help!
Reply With Quote #1

Hey i have a problem...
I want a plugin for my deathmatch server... But its complicated...
I want when a CT Kills a T:
-The CT next round Will be moved to T
-The T next round Will be moved to CT

I have this code but is bugged...
I mean when CT Kills T: the CT next round moved to T but the T isn't moved to CT

Code for fixing:
PHP Code:
#include <amxmodx>
#include <cstrike>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "oxygen"

new nextct[33]
new 
nextt[33]

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_event("DeathMsg""Event_DeathMsg""a")
    
register_logevent("logevent_round_end"2"1=Round_End"
}
public 
Event_DeathMsg()
{
    new 
iKiller read_data(1)
    new 
iVictim read_data(2)
    
    new 
killername[33], victimname[33]
    
get_user_name(iKiller,killername,32)
    
get_user_name(iVictim,victimname,32)
    
    switch(
cs_get_user_team(iVictim))
    {
        case 
CS_TEAM_T:
        {
            
nextct[iVictim] = true
            nextt
[iKiller] = true
        
}
    }
}

public 
logevent_round_end()
{
    new 
players[32], pnumtempid
    get_players
(playerspnum"a"); 
    for( new 
ii<pnumi++ ) 
    { 
        
tempid players[i];
        if(
nextt[tempid])
        {
            
cs_set_user_team(tempidCS_TEAM_T)
        }
        if(
nextct[tempid])
        {
            
cs_set_user_team(tempidCS_TEAM_CT)
        }
    }

__________________
Quote:
Originally Posted by quark View Post
You're a genius
Stopped any pawn work cause of university for computer science

Last edited by oxygen935; 04-15-2013 at 00:48.
oxygen935 is offline
Send a message via Skype™ to oxygen935
 



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 10:54.


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