30.11.2013, 18:48
Quote:
pawn Код:
|
There's if and not If. An as for the example, you don't need to store the vehicleid to a variable and neither use it IsAPlane function twice.
pawn Код:
// Forward it before using it because of the bool tag.
forward bool: IsAPlane(vehicleid);
// ---
CMD:airplane(playerid, params[])
{
if(IsAPlane(GetPlayerVehicleID(playerid))) SendClientMessage(playerid, 0xFFFFFFFF, "You are in a Plane!");
else SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a Plane!");
return 1;
}
// At the bottom:
stock bool: IsAPlane(vehicleid)
{
switch(GetVehicleModel(vehicleid))
{
case 460, 476, 511 .. 513, 519, 520, 553, 577, 592, 593: return true;
}
return false;
}