Jump to content

[REZOLVAT] intrebare


CosminAK
 Share

Recommended Posts

Cel mai bine ar fi sa nu implementezi asa ceva pe server, exista baza de date (si panel eventual) care sa-ti arate asta, plus ca ar consuma ceva resurse, mai ales folosita de mai multi jucatori

edit: burned are comanda /lp care afiseaza ban-urile

Edited by equin0x
Link to comment
Share on other sites

Creezi o comanda care trimite un query in baza de date si apoi afiseaza randurile rezultate.

SELECT `Name` FROM `bans`

if(cache_get_row_count() > 0)
{
new name[MAX_PLAYER_NAME];
cache_get_field_content(0, "Name", name, SQL, MAX_PLAYER_NAME);
SendClientMessage(playerid, 0xFFFFFFFF, name);
}

Respecta si vei fi respectat.

 

BigInt Pawn:

Pacman C++: 

Snake C++:

Minesweeper C++:

 

mattbb.cash

leaks.ro

Link to comment
Share on other sites

  • Administrator

@@iMatt nu cred ca a inteles ce are de facut :))

@@CSORIN poftim:

YCMD:comanda( playerid, params[], help ) {
	if( !PlayerInfo[ playerid ][ pAdmin ] )
		return SCM( playerid, -1, "Nu esti admin" );

	new gQuery[ 256 ];

	mysql_format( SQL, gQuery, sizeof gQuery, "SELECT * FROM `bans` ORDER BY `ID` DESC LIMIT 25" );
	mysql_tquery( SQL, gQuery, "showBans", "d", playerid );

	return true;
}

function showBans( playerid ) {
	if( !cache_get_row_count() )
		return SCM( playerid, -1, "Nu a fost gasit nici un ban." );

	new 
		numeJucator[ 32 ],
		numeAdmin[ 32 ],
		zile,
		string[ 256 ]
	;

	for( new i = 0; i < cache_num_rows(); ++i ) {

		cache_get_field_content( i, "PlayerName", numeJucator, SQL, 32 );
		cache_get_field_content( i, "AdminName", numeAdmin, SQL, 32 );
		zile = cache_get_field_content_int( i, "Days" );

		format( string, sizeof string, "%s%s, banned by %s for %d days.", string, numeJucaotr, numeAdmin, zile );
	}

	ShowPlayerDialog( playerid, 0, DIALOG_STYLE_MSGBOX, "Server Bans:", string, "Ok", "" );

	return true;
}
Link to comment
Share on other sites

 

@@iMatt nu cred ca a inteles ce are de facut :))

@@CSORIN poftim:

YCMD:comanda( playerid, params[], help ) {
	if( !PlayerInfo[ playerid ][ pAdmin ] )
		return SCM( playerid, -1, "Nu esti admin" );

	new gQuery[ 256 ];

	mysql_format( SQL, gQuery, sizeof gQuery, "SELECT * FROM `bans` ORDER BY `ID` DESC LIMIT 25" );
	mysql_tquery( SQL, gQuery, "showBans", "d", playerid );

	return true;
}

function showBans( playerid ) {
	if( !cache_get_row_count() )
		return SCM( playerid, -1, "Nu a fost gasit nici un ban." );

	new 
		numeJucator[ 32 ],
		numeAdmin[ 32 ],
		zile,
		string[ 256 ]
	;

	for( new i = 0; i < cache_num_rows(); ++i ) {

		cache_get_field_content( i, "PlayerName", numeJucator, SQL, 32 );
		cache_get_field_content( i, "AdminName", numeAdmin, SQL, 32 );
		zile = cache_get_field_content_int( i, "Days" );

		format( string, sizeof string, "%s%s, banned by %s for %d days.", string, numeJucaotr, numeAdmin, zile );
	}

	ShowPlayerDialog( playerid, 0, DIALOG_STYLE_MSGBOX, "Server Bans:", string, "Ok", "" );

	return true;
}

imi zice ca nu s-a gasit nici un ban

Link to comment
Share on other sites

imi zice ca nu s-a gasit nici un ban

@@Leonard doar ti-a dat un exemplu, tu ti-l adaptezi singur pentru gm-ul tau.

Respecta si vei fi respectat.

 

BigInt Pawn:

Pacman C++: 

Snake C++:

Minesweeper C++:

 

mattbb.cash

leaks.ro

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...