MySQL Rows in Dialog List - 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: MySQL Rows in Dialog List (
/showthread.php?tid=366213)
MySQL Rows in Dialog List -
quagga - 05.08.2012
How would it be possible to list each row in a mysql query as a menu option in a DIALOG_STYLE_LIST? I can list them in SendClientMessage using sscanf but I can't figure out how to list rows/results in a dialog because in the dialog it all needs to be in one string. Any suggestions/examples? I've tried searching the forums, can't really find any info.
Thanks for your help.
Re: MySQL Rows in Dialog List -
DeathOnaStick - 05.08.2012
You can do sth like this:
pawn Код:
new str[128]; //you have to check how big you need it
for(new i=0; i<ROW_COUNT; i++){
strcat(str, ROW_VALUE);
strcat(str, "\n");
NEXT ROW;
}
Just the pseudocode, you need to add the correct functions. But this is how I would do it.
Re: MySQL Rows in Dialog List -
quagga - 05.08.2012
Thanks, I'll play around with it and see what I can do. +rep