Raised This Month: $ Target: $400
 0% 

Why does it crash?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
n0br41ner
Senior Member
Join Date: May 2012
Location: Planet Earth
Old 10-06-2012 , 07:56   Why does it crash?
Reply With Quote #1

PHP Code:
new players[32], numtempid;
get_playersplayersnum"ae""CT" );
            
if( 
num == )
{
    
client_print0print_chat"%s There are currently no Guards alive."g_szPrefix );
    return 
PLUGIN_HANDLED;
}
            
new 
Float:roundtime get_cvar_float"mp_roundtime" );
roundtime *= 60;
roundtime -= ( get_systime() - g_iRoundStartTime );
set_taskroundtime 495"giveWeaponsT"TASK_PRESIDENT );
            
new 
randomm random_num1num );
            
while( !
is_user_aliveplayers[randomm] ) )
    
randomm random_num1num );
            
g_iPresident randomm;
StripPlayerWeaponsplayers[randomm] );
give_itemplayers[randomm], "weapon_knife" );
give_itemplayers[randomm], "weapon_usp" );
set_user_healthplayers[randomm], 1000 );
set_user_armorplayers[randomm], 300 );
cs_set_user_bpammoplayers[randomm], CSW_USP100 );

for( new 
ii<numi++ ) {
    
tempid players[i];
                
    if( 
tempid != g_iPresident ) {
        
StripPlayerWeaponstempid );
        
give_itemtempid"weapon_knife" );
        
give_itemtempid"weapon_m4a1" );
        
cs_set_user_bpammotempidCSW_M4A190 );
        
set_user_healthtempid100 );
        
set_user_armortempid100 );
    }
}
            
PermanentHUD(); 
I have this function right here, whenever it gets called, the server is crashing, tried to find what the problem is but no luck. Anyone can maybe direct me and tell me whats wrong?

PHP Code:
new players[32], numtempid;
get_playersplayersnum"ae""CT" );
            
if( 
num == )
{
    
client_print0print_chat"%s There are currently no Guards alive."g_szPrefix );
    return 
PLUGIN_HANDLED;
}
            
new 
Float:roundtime get_cvar_float"mp_roundtime" );
roundtime *= 60;
roundtime -= ( get_systime() - g_iRoundStartTime );
set_taskroundtime 495"giveWeaponsT"TASK_PRESIDENT );
            
new 
randomm randomnum );
            
g_iPresident randomm;
StripPlayerWeaponsplayers[randomm] );
give_itemplayers[randomm], "weapon_knife" );
give_itemplayers[randomm], "weapon_usp" );
set_user_healthplayers[randomm], 1000 );
set_user_armorplayers[randomm], 300 );
cs_set_user_bpammoplayers[randomm], CSW_USP100 );

for( new 
ii<numi++ ) {
    
tempid players[i];
                
    if( 
tempid != g_iPresident ) {
        
StripPlayerWeaponstempid );
        
give_itemtempid"weapon_knife" );
        
give_itemtempid"weapon_m4a1" );
        
cs_set_user_bpammotempidCSW_M4A190 );
        
set_user_healthtempid100 );
        
set_user_armortempid100 );
    }
}
            
PermanentHUD(); 
This is the edited version, does not crash anymore but the random player (president) is not chosen when i am all alone on CT team
__________________

Last edited by n0br41ner; 10-06-2012 at 09:07.
n0br41ner 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 06:37.


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