Detecting a Business ID - 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: Detecting a Business ID (
/showthread.php?tid=396949)
Detecting a Business ID -
2KY - 02.12.2012
So, I've currently got something like...
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" );
}
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?
pawn Code:
case DIALOG_MANAGEBIZ:
{
if( response )
{
}
else return plEditingBusiness [ playerid ] = -1;
}
I can't seem to think of anything.