Does not write it out properly
#1

Hello, that would be my problem with this command that when I type then I will not list all the admin names, but write only one line.

(Sorry for bad english)

Код:
else if( Compare(command, "/offlineadminok") ) {
	    if( playerInfo[playerid][pi_admin] < 1 ) return SendClientMessage( playerid, 0xc40000AA, "• {ffffff}(( You are not admin. ))" );
        
        new nevek[50][24],
	    	szam;

		format( Query, sizeof(Query), "SELECT `name` FROM `players` WHERE `admin` > 0");
		mysql_query( Query );
		mysql_store_result();
		
		while( mysql_fetch_row_format(nevek[szam], "|") ) { szam++; }
		
		for( new i; i < szam; i ++ ) {
			format( global_bugfix_string, sizeof(global_bugfix_string), "%s", nevek[i] );
		}

		if( szam == 0 ) {
  			format( global_bugfix_string, sizeof(global_bugfix_string), "There isnt admins.");
		}
		
		SendClientMessage( playerid, 0x6fafbfAA, "(( Offline admins: ))" );
		SendClientMessage( playerid, 0x6fafbfAA, global_bugfix_string );

		return 1;
	}
Reply
#2

Switch to mysql-R39, you using the outdated plugin.
Thats my opnion
Reply
#3

If I do this with a dialog I work properly, but I want to write it out for chat.
Reply
#4

pawn Код:
for( new i; i < szam; i ++ ) {
    format( global_bugfix_string, sizeof(global_bugfix_string), "%s", nevek[i] );
}
You overwrite the string every time. Do something like
pawn Код:
global_bugfix_string[0] = EOS;
for( new i; i < szam; i ++ ) {
    strcat(global_bugfix_string, nevek[i]);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)