Help me warning 206
#1

My error
PHP код:
C:\Documents and Settings\Admin\Desktop\VietOl 1.2\gamemodes\vnit.pwn(21533) : warning 206redundant testconstant expression is non-zero 
My code:
PHP код:
if ((oldkeys KEY_FIRE) && (newkeys KEY_CROUCH))
    {
        new 
weapon GetPlayerWeapon(playerid);
        if(
weapon == 24,25,27,22)
        {
            
ApplyAnimation(playerid,"GYMNASIUM","gym_tread_falloff",1.0,0,0,0,0,0);
            
//GameTextForPlayer(playerid, "~r~Stop c-bug !", 5000, 1);
        
}
    } 
help my
Reply
#2

PHP код:
if ((oldkeys == KEY_FIRE) && (newkeys == KEY_CROUCH)) 
    { 
        new 
weapon GetPlayerWeapon(playerid); 
        if(
weapon == 24,25,27,22
        { 
            
ApplyAnimation(playerid,"GYMNASIUM","gym_tread_falloff",1.0,0,0,0,0,0); 
            
//GameTextForPlayer(playerid, "~r~Stop c-bug !", 5000, 1); 
        

    } 
Reply
#3

Quote:
Originally Posted by Sellize
Посмотреть сообщение
PHP код:
if ((oldkeys == KEY_FIRE) && (newkeys == KEY_CROUCH)) 
    { 
        new 
weapon GetPlayerWeapon(playerid); 
        if(
weapon == 24,25,27,22
        { 
            
ApplyAnimation(playerid,"GYMNASIUM","gym_tread_falloff",1.0,0,0,0,0,0); 
            
//GameTextForPlayer(playerid, "~r~Stop c-bug !", 5000, 1); 
        

    } 
are you kidding me? how u have so much rep .?

the problem is with if(weapon == 24,25,27,22)

u have to do if(weapon == 24 || weapon == 25 || ... ) etc
Reply
#4

Use switch.

pawn Код:
switch(weapon)
{
    case 24, 25, 27, 22:
    {
        ApplyAnimation(playerid,"GYMNASIUM","gym_tread_falloff",1.0,0,0,0,0,0);
        //GameTextForPlayer(playerid, "~r~Stop c-bug !", 5000, 1);
    }
}
Reply
#5

thanks all.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)