>> :..[ HELP ]...: << About stock
#1

pawn Код:
stock IsInVehicleForJob(playerid)
{
  new vehicleid = GetPlayerVehicleID(playerid);
  if(vehicleid == 1 || vehicleid == 2 || vehicleid == 3 || vehicleid == 4 || vehicleid == 5 || vehicleid == 6 || vehicleid == 7 || vehicleid == 8 || vehicleid == 9
    || vehicleid == 10 || vehicleid == 11 || vehicleid == 12 || vehicleid == 13 || vehicleid == 14 || vehicleid == 15 || vehicleid == 16 || vehicleid == 17 || vehicleid == 18
  || vehicleid == 19 || vehicleid == 20 || vehicleid == 21 || vehicleid == 22|| vehicleid == 23 || vehicleid == 24 || vehicleid == 25 || vehicleid == 26 || vehicleid == 27)
}
and i get this errors

C:\Users\NASTIE\Desktop\samp03asvr_R7_win32\gamemo des\Untitled.pwn(365) : error 029: invalid expression, assumed zero
C:\Users\NASTIE\Desktop\samp03asvr_R7_win32\gamemo des\Untitled.pwn(365 -- 366) : warning 215: expression has no effect
C:\Users\NASTIE\Desktop\samp03asvr_R7_win32\gamemo des\Untitled.pwn(366) : error 001: expected token: ";", but found "-end of file-"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.


Reply
#2

You have forgotten return 1;
Reply
#3

lol man, such a long code..
You could do:
pawn Код:
stock IsInVehicleForJob(playerid)
{
    switch(GetPlayerVehicleID(playerid))
    {
        case 1..27: return 1;
    }
    return INVALID_VEHICLE_ID;
}
Reply
#4

Or
pawn Код:
stock IsInVehicleForJob(playerid)
{
    new ID = GetPlayerVehicleID(playerid);
    return (ID > 0 && ID < 28) ? 1 : 0;
}
or

pawn Код:
stock IsInVehicleForJob(vid) return (vid > 0 && vid < 28) ? 1 : 0;
Reply
#5

thanks
Reply


Forum Jump:


Users browsing this thread: