2021-05-18, 01:02 AM
(This post was last modified: 2021-05-18, 01:37 AM by PutuSuhartawan.)
(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.