02.12.2012, 17:08
So, I've currently got something like...
How would I detect the ID of the business they select when the files are named 0.ini, all the way up to, say, 100.ini?
I can't seem to think of anything.
pawn Code:
CMD:managebiz( playerid, params[] )
{
new
bizcount = 0,
bizStr [ 128 ],
holder [ 641 ],
plName [ MAX_PLAYER_NAME ];
GetPlayerName( playerid, plName, MAX_PLAYER_NAME );
for( new b; b < MAX_BUSINESSES; b ++ )
{
if( strcmp( BusinessInfo [ b ] [ Owner ], plName, true ) == 0 && !isnull( BusinessInfo [ b ] [ Owner ] ) )
{
bizcount ++;
format( bizStr, 128, "%s\n", BusinessInfo [ b ] [ Name ], b );
strcat( holder, bizStr, 128 );
EditThisBusiness [ b ] = bizcount - 1;
}
}
if( bizcount == 0 )
return SendClientMessage( playerid, -1, "No businesses found!" );
else return ShowPlayerDialog( playerid, DIALOG_MANAGEBIZ, DIALOG_STYLE_LIST, "Which Business?", holder, "Select", "Cancel" );
}
pawn Code:
case DIALOG_MANAGEBIZ:
{
if( response )
{
}
else return plEditingBusiness [ playerid ] = -1;
}