18.11.2018, 17:06
pawn Код:
#define isnull(%1) ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1])))) //we will use this to check if famname is empty
#define MAX_FAMS 5
new fid = -1; //lets assume "fid" "-1" because we cannot use 0 as it is already a slot for ur family
for(new i = 0; i != MAX_FAMS; i++) //loop
{
if(isnull(FamStat[i][FamName])) //this is how we are gonna find out if there is a family with empty name
{
fid = i; //changing "fid" variable to fetched id
break; //breaking the loop
}
}
if(fid == -1) return SendClientMessage(playerid, 0xffffffff, "No More Empty Slot , Try Again Later"); //if fid is still -1 it means that there were no slot found otherwise it would have fetched an id between 1-5