Jump to content

Cerere comanda /lideri


GenOxigen

Recommended Posts

CMD:leaders( playerid, params [ ] )
{
	new szString[ 1200 ];
	format( szString, sizeof( szString ), "{FFFFFF}LSPD - Lider: %s (%s) - Membri: %d/10n", GetFactionLeader( 1 ), IsOnline( GetFactionLeader( 1 ) ), GetFactionMembers( 1 ) );
         //// ETC
	ShowPlayerDialog( playerid, 3434, DIALOG_STYLE_MSGBOX, "Lista Factiunilor", szString, "Ok", "" );
	return 1;
}
stock IsOnline( szName[ ] )
{
	new szState[ 40 ];
    if( IsPlayerConnected( ReturnUserEx( szName ) ) )
	{
		format( szState, 40, "{C0FF00}Online{FFFFFF}" );
	}
	else format( szState, 40, "{FF0000}Offline{FFFFFF}" );
	return szState;
}

stock GetFactionLeader( FactionID )
{
	new szString[ 128 ], Cache: Result, Get[ 2 ], szLeaderName[ MAX_PLAYER_NAME ];
	format( szString, sizeof( szString ), "SELECT `Name` FROM `users` WHERE `Leader` = %d LIMIT 1;", FactionID );// Aici modifici tu cum ai in baza de date !!
    Result = mysql_query( SQL, szString );
    cache_get_data( Get[ 0 ], Get[ 1 ], SQL );
    if( !Get[ 0 ] ) szLeaderName = "NO-ONE";
   	 else cache_get_field_content( 0, "Name", szLeaderName, SQL, sizeof( szLeaderName ) );
    cache_delete( Result );
	return ( szLeaderName );
}

stock GetFactionMembers( FactionID )
{
	new szString[ 128 ], Cache: Result, Get[ 2 ];
	format( szString, sizeof( szString ), "SELECT `Member` FROM `users` WHERE `Member` = %d", FactionID );// Aici modifici tu cum ai in baza de date !!
    Result = mysql_query( SQL, szString );
    cache_get_data( Get[ 0 ], Get[ 1 ], SQL );
    cache_delete( Result );
	return Get[ 0 ];
}

Edited by Mafia.
Link to comment
Share on other sites

Mda imi da o eroare care nui dau de cap

C:UsersJorjDesktopsaints v1.3gamemodessaints.pwn(2714) : error 017: undefined symbol "ReturnUserEx"
C:UsersJorjDesktopsaints v1.3gamemodessaints.pwn(12491) : warning 217: loose indentation
C:UsersJorjDesktopsaints v1.3gamemodessaints.pwn(12485) : warning 204: symbol is assigned a value that is never used: "string3"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
 
 
1 Error.
Edited by GenOxigen
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.