SA-MP Forums Archive
[Help]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: [Help]Dialog List (/showthread.php?tid=566138)



[Help]Dialog List - Alex_T - 03.03.2015

Hello I would like it to list the persons crime when you type in the persons name. I am very lost at the moment so I am unsure on how to implement this into it. Thanks for the responses.



PHP код:
        case EFactionsDialog_Wanted: {
        {
        if (
response)
        {
        new 
rowsfields;
        new 
id_string[128];
        new 
string[128];
        new 
giveplayerid;
        
giveplayerid ReturnUser(inputtext);
            
            new 
dstring[256];
            new 
sendername[MAX_PLAYER_NAME];
            new 
sqlid strval(inputtext);
            
sendCrimes(playeridsqlid);
            
format(dstringsizeof(dstring), "Players Warrents(%s)\nNumber of Warrents(%d)",string,GetPlayerWantedLevel(giveplayerid));
            
ShowPlayerDialog(playerid,EFactionsDialog_Wanted,DIALOG_STYLE_MSGBOX,"MOBILE DATA COMPUTER",dstring,"Select","Cancel");
            }
        }
    } 
PHP код:
sendCrimes(playeridsqlid) {
    
format(querysizeof(query), "SELECT `crimes`.`id`,`c1`.`username`,`c2`.`username`,`reason`,`issuetime` FROM `crimes` INNER JOIN `characters` AS `c1` ON `c1`.`id` = `suspect` LEFT JOIN `characters` AS `c2` ON `c2`.`id` = `issuer` WHERE `suspect` = %d",sqlid);
    
mysql_function_query(g_mysql_handlequerytrue"OnCrimesRetrieve""d",playerid);

PHP код:
forward OnCrimesRetrieve(playerid);
public 
OnCrimesRetrieve(playerid) {
    new 
rowsfields;
    new 
id_string[128];
    new 
string[128];
    
cache_get_data(rowsfields);
    if(
rows 0) {
        for(new 
i=0;i<rows;i++) {
            
cache_get_row(i2id_string);
            if(!
strcmp(id_string"NULL"true)) {
                
format(stringsizeof(string), "* Issuer: %s",id_string);
                
SendClientMessage(playeridX11_WHITE,string);
            }
            
cache_get_row(i3id_string);
            
format(stringsizeof(string), "* Reason: %s",id_string);
            
SendClientMessage(playeridX11_WHITE,string);
            
cache_get_row(i4id_string);
            if(
id_string[0] == '0') {
                
format(stringsizeof(string), "* Issued: %s",id_string);
                
SendClientMessage(playeridX11_WHITE,string);
            }
        }
    }




Re: [Help]Dialog List - Alex_T - 04.03.2015

bump