Raised This Month: $ Target: $400
 0% 

Server is crashing on my condition


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Tramp
Senior Member
Join Date: Aug 2005
Old 03-24-2008 , 07:53   Server is crashing on my condition
Reply With Quote #1

Called every 2 seconds.

Code(part):
PHP Code:
public plugin_timer()
{


    new 
ts[32];
        
//alive Terrorists
    
new tsa[32];
    new 
cts[32];
    new 
tnum;
        
// alive Terrorists
    
new tnuma;
    new 
ctnum;
    new 
i;


    
// Get teams
    
get_players(tstnum"e""TERRORIST");
    
get_players(ctsctnum"e""CT");
        
//for alive
    
get_players(tsatnuma"ae""TERRORIST");
    


    
// Enough players?

    
    
if(tnum>=mice && ctnum==cats)
    {
        if(
active == 1)
        {
//something there
        
}
        else if (
active == 3)
        {
            if (
phase == 1)
            {
                for(
i=0i<tnumi++)
                {
                    
set_user_maxspeed(ts[i], 0.0);
                    
set_user_gravity(ts[i], 1.0);
                }
                for(
i=0i<ctnumi++)
                {
                    
set_user_maxspeed(cts[i], 0.001);
                    
set_user_gravity(cts[i], 10.0);
                }
            }
            else if (
phase == 2)
            {
                
// Change maxspeeds (Ts can't move, CTs can)
                
for(i=0i<tnumi++)
                {
                    
set_user_maxspeed(ts[i], 0.001);
                    
set_user_gravity(ts[i], 10.0);
                }
                for(
i=0i<ctnumi++)
                {
                    
set_user_maxspeed(cts[i], 0.0);
                    
set_user_gravity(cts[i], 1.0);
                }

// When alive T are <= CATS and All T >= 6 plugin is killing last 2 alive terrorists

                
while(tnuma <= cats && tnum >= 6)
                {
                    
                    
client_cmd(tsa[i], "kill");
                    
msg("[H&S] Ts, killed due to last 2 alive"0);
                    
                }
            }
        }
    }

I've added this to the code:

PHP Code:
                while(tnuma <= cats && tnum >= 6)
                {
                    
                    
client_cmd(tsa[i], "kill");
                    
msg("[H&S] Ts, killed due to last 2 alive"0);
                    
                } 
And with this where there are 2 alives players server is crashing, somebody knows why?
I dont have any idea. Plugin is compiling very well no errors.
__________________
STER-Gaming.pl - The Best Multigaming Club, CS 1.6, CS:S, ET, COD 2 more and more ! Check forum forum.ster-gaming.pl

amxmodx - Polish support about amxx.
Tramp is offline
Lee
AlliedModders Donor
Join Date: Feb 2006
Old 03-24-2008 , 13:35   Re: Server is crashing on my condition
Reply With Quote #2

I wouldn't be surprised if you can't change the gravity and/or maxspeed of a dead player.

Killing people using client_cmd() is vulnerable to being blocked by players.
Lee 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 21:08.


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