Fixes a bug in gangs

Leader isn't shown in the gang members list, because his current gang wasn't being set to his new gang ID.

Upon gang creation, added an SQL query that updates the player's gang ID with the new gang created.
This commit is contained in:
Cloudy 2019-06-09 19:12:44 +03:00
parent a2f11b3786
commit 65df9ffaf3

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;
}