Habe das ganze mal Versucht nur mit "IsPlayerConnected" abzufragen, bleibt das gleiche, habe die Vermutung das es an diesem Stock liegt. (?)
Aktueller Befehl:
CMD:admins(playerid, params[])
{
if(!PlayerInfo[playerid][LoggedIn])return NO_CONYOURSELF
new rows, strDialog[512], strArt[64] = "{FFFFFF}Name:\tRang[Level]\tStatus\n";
new Cache:result = mysql_query(Handle, "SELECT `Name`, `Adminrang`, `LastOnline` FROM `PLAYERS` WHERE `Adminrang` > 0 ORDER BY `Adminrang` DESC LIMIT 0, 15");
cache_get_row_count(rows);
if(rows)
{
new admName[25], admRang, LastOnline[30];
for(new i; i < rows; i++){
cache_get_value_name(i, "Name", admName, 25);
cache_get_value_name(i, "LastOnline", LastOnline, 30);
cache_get_value_name_int(i, "Adminrang", admRang);
new isOnline = GetID(admName);
if(IsPlayerConnected(isOnline)){
format(strDialog, sizeof(strDialog), "%s{FFFFFF}%s\t%s[%d]\t{00CC00}• {FFFFFF}Online", strDialog, admName, GetPlayerAdminRang(isOnline), admRang);
}else{
format(strDialog, sizeof(strDialog), "%s{FFFFFF}%s\t%s[%d]\t%s", strDialog, admName, GetPlayerAdminRang(isOnline), admRang, LastOnline);
}
strcat(strArt, strDialog);
printf("DEBUG - String:\n%s", strDialog);
}
cache_delete(result);
ShowPlayerDialog(playerid, DIA_ERROR, DIALOG_STYLE_TABLIST_HEADERS, "{CC6600}"#SERVER_NAME" {FFFFFF}- Teammitglieder", strDialog, "Schließen", "");
}
return 1;
}
stock "GetID"
GetID(name[])
{
for(new i, j = GetPlayerPoolSize(); i <= j; i++)
{
new playeRname[MAX_PLAYER_NAME+1];
GetPlayerName(i, playeRname, sizeof(playeRname));
if(!strcmp(PlayerInfo[i][Name], name, true)) return i;
}
return INVALID_PLAYER_ID;
}