Dialog Style List,automatic mysql case
#1

Hello sa-mp.com is possible to make additional case in a dialog with an additional row in mysql?
I try something but don;t work,don't show the dialog
This is my command
Код:
	    LoadPlayerFines(playerid);
	    new stringd[256],finelist[256];
	    for(new fine;fine<MAX_FINES;fine++)
	    {
	        format(finelist,sizeof(finelist),"Amenda #%d [{4747D1}$%d{FFFFFF}] pentru '%s'",FinesInfo[playerid][fId],FinesInfo[playerid][fPret],FinesInfo[playerid][fPentru]);
	    }
	    ShowPlayerDialog(playerid, 432,DIALOG_STYLE_LIST,"Fines", stringd, "Detalii", "Close");
	    return 1;
	}
This is LoadPlayerFines
Код:
stock LoadPlayerFines( playerid )
{
	if( IsPlayerConnected( playerid ) )
    {
        new DataString[ 1536 ], Query[ 1536 ], sendername[256];
        GetPlayerName(playerid, sendername, sizeof(sendername));
        format( Query, sizeof( Query ), "SELECT * FROM `fines` WHERE `Posesor` = '%s'", sendername);
        if(mysql_query( Query ))
        {
            mysql_store_result();
        } else {
            mysql_free_result();
            SendClientMessage( playerid, COLOR_WHITE, "MYSQL ERROR LAV, feel free to report this bug by SS'ing it and send it to a dev." );
            printf("Could not call loadaccountvariables query %d %d",playerid,PlayerInfo[playerid][pDatabaseID]);
            Kick(playerid);
        }
        printf(" SQL: %s",Query);
	    for(new fine;fine<MAX_FINES;fine++)
	    {
	        mysql_fetch_field( "ID", DataString );
	        FinesInfo[ playerid ][ fId ] = strval( DataString );

	        mysql_fetch_field( "Politist", DataString );
	        strmid(FinesInfo[ playerid ][ fPolitist ], DataString, 0, strlen(DataString), 255);

	        mysql_fetch_field( "Pret", DataString );
	        FinesInfo[ playerid ][ fPret ] = strval( DataString );

	        mysql_fetch_field( "Pentru", DataString );
	        strmid(FinesInfo[ playerid ][ fPentru ], DataString, 0, strlen(DataString), 255);
		}
        mysql_free_result();
	}
	return 1;
}
Reply
#2

Try using MySQL command "Update" in this case to create new Row in your current tablel!
Reply
#3

I need to create another case in dialog,no in mysql xd .I need to make a list with all fines,but i don't know how to make this in pawno.If you have 3 tickets,only 1 is showed
Reply
#4

Someone ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)