Őőőőm, jelenleg így néz ki, de nemjó, mert csak az onlineokat írja ki...
if(listitem == 0)
{
new query[128];
mysql_format(MySQL, query, sizeof(query), \"SELECT * FROM `accountok` WHERE `Frakció` = \'%d\'\", Jatekos[playerid][Frakcio]);
mysql_tquery(MySQL, query, \"FrakcioTagok\", \"d\", playerid);
return 1;
}
És:
forward FrakcioTagok(playerid);
public FrakcioTagok(playerid)
{
new numrows = cache_get_row_count(MySQL);
new username[MAX_PLAYER_NAME], string[128];
if(numrows)
{
for(new i; i <numrows; i++)
{
cache_get_field_content(i, \"Név\", username, sizeof(username));
new prang = cache_get_row_int(0, 13);
if(ReturnUser(username)!= INVALID_PLAYER_ID)
{
format(string, sizeof(string), \"Név: %s | Rang: %s\", username, Rangok[prang][2]);
return SendClientMessage(playerid, -1, string);
}
else
{
format(string, sizeof(string), \"%s[OFFLINE]\", username);
SendClientMessage(playerid, -1, string);
}
}
}
return 1;
}
Dupla hozzászólás automatikusan összefûzve. ( 2015. augusztus 27. - 23:17:52 )
És még ez.
stock ReturnUser(text[], playerid = INVALID_PLAYER_ID)
{
#pragma unused playerid
new pos = 0;
while (text[pos] < 0x21)
{
if (text[pos] == 0) return INVALID_PLAYER_ID;
pos++;
}
new userid = INVALID_PLAYER_ID;
if (IsNumeric(text[pos]))
{
userid = strval(text[pos]);
if (userid >=0 && userid < MAX_PLAYERS)
{
if(!IsPlayerConnected(userid))
userid = INVALID_PLAYER_ID;
else return userid;
}
}
return 1;
}
stock IsNumeric(const string[])
{
new i;
while(string != \'\\0\') //end of string
{
if (string > \'9\' || string < \'0\'){return 0;}
i++;
}
return 1;
}