Raised This Month: $51 Target: $400
 12% 

Problem with Displaying call stack trace


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BrUn3S
Member
Join Date: Jan 2012
Location: Slovakia
Old 07-12-2015 , 04:38   Problem with Displaying call stack trace
Reply With Quote #1

Hi guys, i have problem with a piece of code... Compiler doesn't give me any errors, but server console give me this result

Console:
PHP Code:
L 07/12/2015 10:28:05: [SMDisplaying call stack trace for plugin "jailbreak.smx":
L 07/12/2015 10:28:05: [SM]   [0]  Line 673, \addons\sourcemod\scripting\jailbreak.sp::ResetHP()
L 07/12/2015 10:28:05: [SM]   [1]  Line 591, \addons\sourcemod\scripting\jailbreak.sp::mod_prestrelka()
L 07/12/2015 10:28:05: [SM]   [2]  Line 581, \addons\sourcemod\scripting\jailbreak.sp::SimonMS() 
Code:
PHP Code:
public SimonMS(Handle:menuMenuAction:actionclientparam2)
{
    if (
action == MenuAction_Select)
    {
        new 
String:info[32];
        
GetMenuItem(menuparam2infosizeof(info));
        
        if(
strcmp(info,"choose1") == 0)
        {
            
mod_prestrelka();
        }
    }
}

public 
void mod_prestrelka()
{
    
AktMod 1//mod prestrelka 1
    
OnOpenJails();
    
ResetHP();
    
    for (new 
1<= MaxClientsi++)
    {
        if(
IsClientInGame(i) || IsPlayerAlive(i))
        {
            
OpenGunsMenu(i);
            
ModHintText(i"Prestrelka");
            
PlaySoundAll(2);
        }
    }
}

stock void ResetHP()
{
    for(new 
1<= MaxClientsi++)
    {
        if((
GetClientTeam(i) == CS_TEAM_T || IsPlayerVIP(i)) && IsClientInGame(i))
        {
            
SetEntityHealth(i100);
        }
    }

When I call mod_prestrelka, ResetHP, OpenGunsMenu, ModHintText, PlaySoundAll doesn't work.
What I doing wrong? Thanks.
BrUn3S is offline
Mainstaff
AlliedModders Donor
Join Date: May 2011
Old 07-12-2015 , 07:15   Re: Problem with Displaying call stack trace
Reply With Quote #2

Always check for IsClientConnected and IsClientInGame first.

PHP Code:
stock void ResetHP() 

    for(new 
1<= MaxClientsi++) 
    { 
        if(
IsClientConnected(i) && IsClientInGame(i) && (GetClientTeam(i) == CS_TEAM_T || IsPlayerVIP(i))) 
        { 
            
SetEntityHealth(i100); 
        } 
    } 

Maybe also checking for IsPlayerAlive, but thats optional.

Last edited by Mainstaff; 07-12-2015 at 07:17.
Mainstaff 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 07:04.


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