09.11.2016, 12:39
In other words you want to show the name of the offline players for that faction and skip the connected?
First of all, returning a value in a loop breaks it completely. Store the rows to a variable instead of keep calling cache_get_row_count in every iteration.
I don't get why you are trying to send the rowid as a client message and not the name of the player.
Use sscanf to check if a player is connected than GetPlayerID + IsPlayerConnected functions, much faster. If you insist on using your way, at least use GetPlayerPoolSize or even better foreach/y_iterate for the player-loops.
Last, if you want only to retrieve the name then don't select all the data in the query but this certain column:
"SELECT Username FROM ..."
First of all, returning a value in a loop breaks it completely. Store the rows to a variable instead of keep calling cache_get_row_count in every iteration.
I don't get why you are trying to send the rowid as a client message and not the name of the player.
Use sscanf to check if a player is connected than GetPlayerID + IsPlayerConnected functions, much faster. If you insist on using your way, at least use GetPlayerPoolSize or even better foreach/y_iterate for the player-loops.
Last, if you want only to retrieve the name then don't select all the data in the query but this certain column:
"SELECT Username FROM ..."