31.05.2015, 09:10
I have table name "factions" and i want to extract the value of a row "groupSlots" WHERE id=1 (for faction id=1)
i've tried this
and in cmd:factions
groupSlots for faction id 1 value is 6
but on server when running "/factions" returns me something else...
i've tried this
Код:
stock GetFactionSlots( FactionID )
{
new szString[ 128 ], Cache: Result, Get[ 2 ], szFacSlots[ MAX_PLAYER_NAME ];
format( szString, sizeof( szString ), "SELECT `groupSlots` FROM `factions` WHERE `ID` = %d ;", FactionID );
Result = mysql_query( SQL, szString );
cache_get_data( Get[ 0 ], Get[ 1 ], SQL );
if( !Get[ 0 ] ) szFacSlots = "No-One";
else cache_get_field_content( 0, "groupSlots", szFacSlots, SQL, sizeof( szFacSlots ) );
cache_delete( Result );
return ( szFacSlots );
}
Код:
new szString[ 1200 ];
format( szString, sizeof( szString ), "{0059FF}Police Departament {ffffff}- Lider: %s (%s) - Membri: %d/%d\n", GetFactionLeader( 1 ), IsOnline( GetFactionLeader( 1 ) ), GetFactionMembers( 1 ) , GetFactionSlots( 1 ) );
but on server when running "/factions" returns me something else...

