04.12.2016, 20:10
(
Последний раз редактировалось TheRohlikar; 06.12.2016 в 11:06.
Причина: dunno
)
Hello everybody,
I am using Stricken Kid's MySQL plugin.
No problem at all, everything's fine... except for one.
So... as you can see, I use my own function "GetDialogText" which should do, that it takes something (string) from database. Well, it doesn't work as I want.
When I used "print" just to be sure that everything works, it shows me... "printf("WHAT: second_button | VALUE: Disconnect");"... It would be great, but "second_button" is last thing I want.
And what is worse, it drops a server...
Thank you very much for your help, if you do not understand to my explanation, then... try it again.
OH.. btw. I used commands /log and /reg to take some values (from another table), before I made this creature. And it normally worked and there is any different between that.
I am using Stricken Kid's MySQL plugin.
No problem at all, everything's fine... except for one.
Код HTML:
stock GetDialogText(id, what[]){ new query[128], value[512], whatisit[25]; strcat(whatisit, what); format(query, sizeof(query), "SELECT * FROM `dialogs` WHERE dialogid='%d'", id); mysql_query(query); mysql_store_result(); if(mysql_num_rows() != 0) { while(mysql_fetch_row(query)){ mysql_fetch_field(what, value); printf("WHAT: %s | VALUE: %s", whatisit, value); mysql_free_result(); return value; } }else printf("DIALOG '%d' DOESN'T EXIST!", id); mysql_free_result(); return value; }
When I used "print" just to be sure that everything works, it shows me... "printf("WHAT: second_button | VALUE: Disconnect");"... It would be great, but "second_button" is last thing I want.
Код HTML:
ShowPlayerDialog(playerid, DG_REG, strval(GetDialogText(DG_REG, "style")), GetDialogText(DG_REG, "caption"), GetDialogText(DG_REG, "text"), GetDialogText(DG_REG, "first_button"), GetDialogText(DG_REG, "second_button"));
Thank you very much for your help, if you do not understand to my explanation, then... try it again.
OH.. btw. I used commands /log and /reg to take some values (from another table), before I made this creature. And it normally worked and there is any different between that.