22.09.2018, 15:01
thanks, worked now but I have another problem.
When I open the dialog for the first time, it shows no problem but whenever I open it for second time or third or more, it doubles up (example below)
When I open the dialog for the first time, it shows no problem but whenever I open it for second time or third or more, it doubles up (example below)
PHP код:
/* What I mean is like this (dialog):
Username 1
Username 2
Username 3
Now when I reopen the dialog 2nd time:
Username 1
Username 2
Username 3
Username 1
Username 2
Username 3
and so on.
*/
case 6:
{
if(strcmp(House[tmpid][tmpowner], PlayerName(playerid), false) && PlayerInfo[playerid][power] < 4) return SendClientError(playerid, "You don't own this house!");
{
new Query[256];
mysql_format(sqldb, Query, sizeof Query, "SELECT * FROM `HouseKeys` WHERE `houseid` = '%d'", tmpid);
mysql_tquery(sqldb, Query, "OnPlayerDupekeyLoad", "i", playerid);
new laststring[400],string[400];
for(new i = 0; i < DupekeyCount[playerid]; i++)
{
format(laststring,sizeof(laststring),"%%s\n",laststring,DupekeyString[playerid][i]);
}
format(string,sizeof(string),"{FF0000}[+] {FFFFFF}Create a new key\n");
strcat(string,laststring);
ShowPlayerDialog(playerid,3001,DIALOG_STYLE_LIST,"Manage Duplicate Keys",string,"Select","Cancel");
return 1;
}
}