Jump to content

[REZOLVAT] Select * FROM


Jakewow
 Share

Recommended Posts

CMD:uratii( playerid, params [ ] ) {
	if( PlayerInfo[ playerid ][ pAdmin ] <= 4 )return 0;
	new 
		query[ 56 ];
	mysql_format( SQL, query, sizeof query, "SELECT * FROM `urat`" );
	mysql_tquery( SQL, query, "GetUrati", "d", playerid );
	return 1;
}

function GetUrati( playerid ) {
	if( cache_get_row_count( ) == 0 )return SendClientMessage( playerid, -1, "No result found." );
	new ID, playerNick[ MAX_PLAYER_NAME ], ID_joc, dialog_text[ 512 ], one_row[ 56 ];

	for( new i = 0; i < cache_num_rows( ); i++ ){
		ID = cache_get_field_content_int( i, "id" );
		cache_get_field_content( i, "NUME", playerNick );
		ID_joc = cache_get_field_content_int( i, "IDJOC" );

		format( one_row, sizeof one_row, "%d -> %s -> %d\n", ID, playerNick, ID_joc );
		strcat( dialog_text, one_row );
	}
	ShowPlayerDialog( playerid, 0, DIALOG_STYLE_MSGBOX, "Urati:", dialog_text, "Close", "" );

	return 1;
}

Daca primesti vreo eroare/warning sa-mi spui, nu am apucat sa compilez codul. Ar trebuii sa mearga bine.

Edited by BuhaAdv

bcugZLK.png 

bwTYRvf.png

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...