changed /turfs into /gang turfs

This commit is contained in:
Steven Howard 2018-10-05 19:14:57 +01:00
parent 4ebaf037a0
commit 2789c3f234

View File

@ -9849,7 +9849,11 @@ CMD:gangs( playerid, params[ ] )
return ShowPlayerDialog( playerid, DIALOG_GANG_LIST, DIALOG_STYLE_TABLIST_HEADERS, "Gangs List", szHugeString, "Select", "Cancel" ); return ShowPlayerDialog( playerid, DIALOG_GANG_LIST, DIALOG_STYLE_TABLIST_HEADERS, "Gangs List", szHugeString, "Select", "Cancel" );
} }
CMD:turfs( playerid, params[ ] ) CMD:gang( playerid, params[ ] )
{
if ( p_Class[ playerid ] != CLASS_CIVILIAN ) return SendError( playerid, "This is restricted to civilians only." );
if ( !strcmp( params, "turfs", false, 5 ) )
{ {
if ( !Iter_Count( turfs ) ) if ( !Iter_Count( turfs ) )
return SendError( playerid, "There is currently no trufs on the server." ); return SendError( playerid, "There is currently no trufs on the server." );
@ -9876,13 +9880,7 @@ CMD:turfs( playerid, params[ ] )
return ShowPlayerDialog( playerid, DIALOG_NULL, DIALOG_STYLE_TABLIST, ""COL_WHITE"Gang Turfs", szHugeString, "Close", "" ); return ShowPlayerDialog( playerid, DIALOG_NULL, DIALOG_STYLE_TABLIST, ""COL_WHITE"Gang Turfs", szHugeString, "Close", "" );
} }
else if ( !strcmp( params, "leader", false, 6 ) )
CMD:gang( playerid, params[ ] )
{
if ( p_Class[ playerid ] != CLASS_CIVILIAN ) return SendError( playerid, "This is restricted to civilians only." );
if ( !strcmp( params, "leader", false, 6 ) )
{ {
new new
pID pID
@ -18052,6 +18050,16 @@ stock SaveGangData( gangid )
mysql_single_query( szLargeString ); mysql_single_query( szLargeString );
} }
stock IsPlayerGangCoLeader( accountid, gangid )
{
for ( new i = 0; i < MAX_COLEADERS; i ++ ) {
if ( g_gangData[ gangid ] [ E_COLEADER ] [ i ] == accountid )
return true;
}
return false;
}
stock IsPlayerGangLeader( playerid, gangid, only_leader = 0 ) { stock IsPlayerGangLeader( playerid, gangid, only_leader = 0 ) {
if ( g_gangData[ gangid ] [ E_LEADER ] == p_AccountID[ playerid ] ) if ( g_gangData[ gangid ] [ E_LEADER ] == p_AccountID[ playerid ] )
@ -21072,7 +21080,7 @@ thread OnListGangMembers( playerid, gangid, page )
for( i = 0, szLargeString[ 0 ] = '\0'; i < rows; i++ ) for( i = 0, szLargeString[ 0 ] = '\0'; i < rows; i++ )
{ {
cache_get_field_content( i, "NAME", userName ); cache_get_field_content( i, "NAME", userName );
format( szLargeString, sizeof( szLargeString ), "%s%s%s\n", szLargeString, cache_get_field_content_int( i, "ONLINE", dbHandle ) ? ( #COL_GREEN ) : ( #COL_WHITE ), userName ); format( szLargeString, sizeof( szLargeString ), "%s%s%s\t"COL_GREY"%s\n", szLargeString, cache_get_field_content_int( i, "ONLINE", dbHandle ) ? ( #COL_GREEN ) : ( #COL_WHITE ), userName, IsPlayerGangCoLeader( cache_get_field_content_int( i, "USER_ID", dbHandle ), gangid ) ? () : () );
} }
SetPVarInt( playerid, "gang_members_id", gangid ); SetPVarInt( playerid, "gang_members_id", gangid );