SA-MP Forums Archive
Pawno Warning ! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Pawno Warning ! (/showthread.php?tid=356753)



Pawno Warning ! - farCry.xD - 04.07.2012

Hey , I get this warning :
Код:
C:\Documents and Settings\nearCry\Desktop\ASTA\gamemodes\RNSGM.pwn(13051) : warning 206: redundant test: constant expression is non-zero
At the line :
Код:
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 448, 461, 462, 463, 468, 521, 522)
Why ? THX :*


Re: Pawno Warning ! - tyler12 - 04.07.2012

incorrect or unneeded parameters
aint it meant to be |

pawn Код:
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 448 | 461 | 462 | 463 | 468 | 521 | 522)



Re: Pawno Warning ! - Vince - 04.07.2012

Still wrong;
pawn Код:
new model = GetVehicleModel(GetPlayerVehicleID(playerid));
if(model == 448 || model == 461 || model == 462 || /* you get the point */) {}
Or use switch;

pawn Код:
switch(GetVehicleModel(GetPlayerVehicleID(playerid)))
{
    case 448, 461, 462, 463, 468, 521, 522: {}
}



Respuesta: Pawno Warning ! - farCry.xD - 04.07.2012

Thx , it work's :X