• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] [SOLVED] How Find New ID from enum for SQL with forward loop function ?
#3
(2021-05-18, 12:52 AM)Radical Wrote: An example how to get free id from a variable enum:

Code:
GetFreeSlot() { ? ? for (new i; i < size; i) { ? ? ? ? if (!Var[i][InUse]) { ? ? ? ? ? ? return i; ? ? ? ? } ? ? } ? ? return -1; }



Sir but what about using 3 arrays as I used? is need twice forward function?



PHP Code:
GetFreeTrunkID() { ? ? for(new v; v <= MAX_VEHICLES; v) ? ? { ? ? ? ? ? for (new s; s <= MAX_TRUNK_SLOTS; s) { ? ? ? ? ? ? if (!get_vehicle_trunk[v][s][TRUNK_SQL_ID]) { ? ? ? ? ? ? ? ? return v; ? ? ? ? ? ? } ? ? ? ? ? } ? ? } ? ? ? ? ? ? return -1; }



?return i; is not work on me sir. the return steal on 0. Nothink different from increment every adding new query from pawn.
  Reply


Messages In This Thread
RE: HELP! How Find New ID from enum for SQL with forward loop function ? - by PutuSuhartawan - 2021-05-18, 01:02 AM