Merge pull request #34 from meCloudy/gangbug-fix

Fixes a bug in gangs
This commit is contained in:
Lorenc Pekaj 2019-06-10 20:09:15 +10:00 committed by GitHub
commit 8f63bf2510
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -649,6 +649,7 @@ thread OnPlayerGangLoaded( playerid )
thread OnGangAdded( gangid )
{
g_gangData[ gangid ] [ E_SQL_ID ] = cache_insert_id( );
mysql_single_query( sprintf( "UPDATE `USERS` SET `GANG_ID`=%d WHERE `ID`=%d", g_gangData[ gangid ] [ E_SQL_ID ], g_gangData[ gangid ][ E_LEADER ] ) );
return 1;
}
@ -770,6 +771,10 @@ thread OnGangKickOffline( playerid, gangid )
mysql_single_query( sprintf( "DELETE FROM `GANG_COLEADERS` WHERE `USER_ID`=%d", player_accid ) );
mysql_single_query( sprintf( "UPDATE `USERS` SET `GANG_ID`=-1 WHERE `ID`=%d", player_accid ) );
for ( new i = 0; i < MAX_COLEADERS; i++ ) if ( g_gangData[ gangid ] [ E_COLEADER ] [ i ] == player_accid ) {
g_gangData[ gangid ] [ E_COLEADER ] [ i ] = 0;
}
SendClientMessageToGang( static_gangid, g_gangData[ static_gangid ] [ E_COLOR ], "[GANG]{FFFFFF} %s has left the gang (KICKED)", player_name );
}
else