What the...
#1

Код:
warning 206: redundant test: constant expression is non-zero
These are the lines
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	if(PRESSING(newkeys, KEY_YES)) //line of warning
	{
	    if(IsPlayerInAnyVehicle(playerid))
	    {
	        SetVehicleVelocity(GetPlayerVehicleID(playerid), 0.0, 0.0, 0.2);
	        return 1;
		}
	}
	return 1;
}
Reply
#2

You are using a macro done in the wiki.

Use:

Код:
if(newkeys == KEY_YES))
{
   if(IsPlayerInAnyVehicle(playerid))
   {
      SetVehicleVelocity(GetPlayerVehicleID(playerid), 0.0, 0.0, 0.2);
      return 1;
      }
}
Reply
#3

Thank you. It worked
Reply
#4

I recommend you to use:

if(newkeys & KEY_YES)

Because you'll can to press Y key when you are already pressing another button..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)