Posts: 737
Threads: 338
Joined: Jan 2013
Код:
foreach(new allplayerqq : Player)
{
if(cache_num_rows())
{
for(new r=0; r < cache_get_row_count(); ++r)
{
cache_get_row(r, 0, internetplayername);
format( createstring,25,"%s", internetplayername );
SendClientMessage( allplayerqq,COLOR_YELLOW,createstring );
}
}
}
What i have mean, can i do foreach and then do a for(new and get a information from mysql for everone player?
Posts: 1,164
Threads: 20
Joined: Oct 2008
Reputation:
0
Yes. You can put loops inside loops inside loops inside loops (x infinity).
I recommend putting the cache_num_rows check outside the first loop, otherwise it would check to all players and stop if it's missing all the times.
Posts: 737
Threads: 338
Joined: Jan 2013
But i mean, when i will do it for first player
for(new r=0; r < cache_get_row_count(); ++r)
{
And then when will be other player, i too can get
for(new r=0; r < cache_get_row_count(); ++r)
{
?