Raised This Month: $32 Target: $400
 8% 

Solved I need help to remove warnings when compiling


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Tank Rush
Senior Member
Join Date: May 2019
Location: Argentina
Old 04-29-2021 , 20:00   I need help to remove warnings when compiling
Reply With Quote #1

I receive warnings when I compile, I know that there will be no glitches in the game and I can ignore it, but I don't like it when it appears, preferably it is better to have a cleaner code.

Code:
//// l4d_blackandwhite.sp
//
// D:\Program Files\Steam\steamapps\common\Left 4 Dead 2\left4dead2\addons\sourcemod\scripting\l4d_blackandwhite.sp(138) : warning 234: symbol "GetMaxClients" is marked as deprecated: Use MaxClients variable instead.
//
//
// D:\Program Files\Steam\steamapps\common\Left 4 Dead 2\left4dead2\addons\sourcemod\scripting\l4d_blackandwhite.sp(149) : warning 234: symbol "GetMaxClients" is marked as deprecated: Use MaxClients variable instead.
Here:
PHP Code:
        //print to infected
        
else if(bandw_notice == 3)
        {
            for( new 
1<= GetMaxClients(); x++)
            {
                if(!
IsClientInGame(x) || GetClientTeam(x) == GetClientTeam(target) || == target || IsFakeClient(x))
                    continue;
                if(
bandw_type == 1PrintHintText(x"%s (\x04%s\x01) is black and white."targetNamecharName);
                else 
CPrintToChat(x"{red}[{green}!{red}] {olive}%s{red} is black and white."targetName);
            }
        }
        
//print to survivors
        
else
        {
            for( new 
1<= GetMaxClients(); x++)
            {
                if(!
IsClientInGame(x) || GetClientTeam(x) != GetClientTeam(target) || == target || IsFakeClient(x)) 
                    continue;
                    
                if(
bandw_type == 1PrintHintText(x"%s (\x04%s\x01) is black and white."targetNamecharName);
                else 
CPrintToChat(x"{red}[{green}!{red}] {olive}%s{red} is black and white."targetName);
            }
        } 
Code:
//// l4d_tank_damage_announce.sp
//
// D:\Program Files\Steam\steamapps\common\Left 4 Dead 2\left4dead2\addons\sourcemod\scripting\l4d_tank_damage_announce.sp(355) : warning 234: symbol "FloatMul" is marked as deprecated: This native is internal implementation. For multiplication use the '*' operator.
//
//
// D:\Program Files\Steam\steamapps\common\Left 4 Dead 2\left4dead2\addons\sourcemod\scripting\l4d_tank_damage_announce.sp(355) : warning 234: symbol "FloatDiv" is marked as deprecated: This native is internal implementation. For division use the '/' operator.
//
//
// D:\Program Files\Steam\steamapps\common\Left 4 Dead 2\left4dead2\addons\sourcemod\scripting\l4d_tank_damage_announce.sp(360) : warning 234: symbol "FloatMul" is marked as deprecated: This native is internal implementation. For multiplication use the '*' operator.
//
//
// D:\Program Files\Steam\steamapps\common\Left 4 Dead 2\left4dead2\addons\sourcemod\scripting\l4d_tank_damage_announce.sp(360) : warning 234: symbol "FloatDiv" is marked as deprecated: This native is internal implementation. For division use the '/' operator.
Here:
PHP Code:
GetDamageAsPercent(damage)
{
    return 
RoundToFloor(FloatMul(FloatDiv(float(damage), g_fMaxTankHealth), 100.0));
}

bool:IsExactPercent(damage)
{
    return (
FloatAbs(float(GetDamageAsPercent(damage)) - FloatMul(FloatDiv(float(damage), g_fMaxTankHealth), 100.0)) < 0.001) ? true:false;

__________________
Sorry i don't speak english very well

--->My name is Source and I'm on Steam<---
Discord: Source#9382

Last edited by Tank Rush; 04-29-2021 at 20:41.
Tank Rush is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 04-29-2021 , 20:09   Re: I need help to remove warnings when compiling
Reply With Quote #2

Change "GetMaxClients()" to "MaxClients".
PHP Code:
        //print to infected
        
else if(bandw_notice == 3)
        {
            for( new 
1<= MaxClientsx++)
            {
                if(!
IsClientInGame(x) || GetClientTeam(x) == GetClientTeam(target) || == target || IsFakeClient(x))
                    continue;
                if(
bandw_type == 1PrintHintText(x"%s (\x04%s\x01) is black and white."targetNamecharName);
                else 
CPrintToChat(x"{red}[{green}!{red}] {olive}%s{red} is black and white."targetName);
            }
        }
        
//print to survivors
        
else
        {
            for( new 
1<= MaxClientsx++)
            {
                if(!
IsClientInGame(x) || GetClientTeam(x) != GetClientTeam(target) || == target || IsFakeClient(x)) 
                    continue;
                    
                if(
bandw_type == 1PrintHintText(x"%s (\x04%s\x01) is black and white."targetNamecharName);
                else 
CPrintToChat(x"{red}[{green}!{red}] {olive}%s{red} is black and white."targetName);
            }
        } 
Change "FloatDiv" to "/" and "FloatMulti" to "*".
PHP Code:
GetDamageAsPercent(damage)
{
    return 
RoundToFloor((float(damage) / g_fMaxTankHealth) * 100.0);
}

bool:IsExactPercent(damage)
{
    return (
FloatAbs(float(GetDamageAsPercent(damage)) - ((float(damage) / g_fMaxTankHealth) * 100.0)) < 0.001) ? true:false;

__________________
Psyk0tik is offline
Tank Rush
Senior Member
Join Date: May 2019
Location: Argentina
Old 04-29-2021 , 20:41   Re: I need help to remove warnings when compiling
Reply With Quote #3

thank you Crasher_3637
__________________
Sorry i don't speak english very well

--->My name is Source and I'm on Steam<---
Discord: Source#9382
Tank Rush 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 15:17.


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