SA-MP Forums Archive
OnToTheNext - 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: OnToTheNext (/showthread.php?tid=389715)



OnToTheNext - Glad2BeHere - 03.11.2012

drawing and example like if i do in my player info
Код:
pHOUSES[10],
if i buy a house how to say if 1 of is taken by the id of the house go on to the next slot?


Re: OnToTheNext - Niko_boy - 03.11.2012

loop through all houses and u must have assigned a value to each id by default say -1 or a boolean variable/array telling if slow is used e.g.
pawn Код:
for( new i; i < TOTALNUMBERHOUSE; i++ )
{
     if( pHouseUsed[i] == true /* or != -1 etc.. */ )
     {
        /*return i; // if a stock or use this i as next slot id directly */
        break;
     }
}



Re: OnToTheNext - Glad2BeHere - 03.11.2012

yeah i have MAX_HOUSES