SA-MP Forums Archive
Small dialog problem - 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: Small dialog problem (/showthread.php?tid=598328)



Small dialog problem - Squirrel - 11.01.2016

Alright so me again lol

the dialog shows only last thing it found, if I do it all with SendClientMessage it works but dialog shows only last found data

PHP код:
for(new i=0rowsi++) {
        
cache_get_field_content(i"Reason"string);
        
format(reasonsizeof(string), string);
        
        
cache_get_field_content(i"Date"dateString);
        
format(dateNowsizeof(dateString), dateString);
        
        
format(mainstring,sizeof(mainstring),"%s\t%s\n",string,dateString);
        
crimecount++;
    }
    if(
crimecount == 0) return Msg(playerid,COLOR_RED,"No results found for this person");
    else if(
crimecount >= 1) return ShowPlayerDialog(playerid,DIALOG_PLAYER_CRIMES,DIALOG_STYLE_TABLIST,"Test",mainstring,"Confirm","Decline"); 



Re: Small dialog problem - itsCody - 11.01.2016

Where are you using this?


Re: Small dialog problem - Jefff - 11.01.2016

pawn Код:
for(new i=0; i < rows; i++)
{
    cache_get_field_content(i, "Reason", string);
    cache_get_field_content(i, "Date", dateString);

    format(mainstring,sizeof(mainstring),"%s%s\t%s\n",mainstring,string,dateString);
    crimecount++;
}



Re: Small dialog problem - Squirrel - 11.01.2016

Quote:
Originally Posted by itsCody
Посмотреть сообщение
Where are you using this?
PHP код:
mysql_format(mysqlquerysizeof(query),"SELECT `Name`,`IssuedBy`,`Reason`, `Date` FROM `crimes` WHERE `Name`='%e'",somename);
    
mysql_tquery(mysqlquery"OnCrimeLoad","i",playerid); 
PHP код:
forward OnCrimeLoad(playerid);
public 
OnCrimeLoad(playerid)
{
    new 
reason[128],
        
string[128],
        
        
dateNow[128],
        
dateString[128],
        
rows cache_num_rows(),
        
        
someName[24],
        
someStringName[24],
        
        
IssuedByOmg[24],
        
IssuedByString[24],
        
        
crimecount,
        
mainstring[1024];
    for(new 
i=0rowsi++) { 



Re: Small dialog problem - itsCody - 11.01.2016

Do what Jefff said above.


Re: Small dialog problem - Squirrel - 11.01.2016

omg Jeff & Code <3 u both! Thanks for the help! THAT WORKED!