Hallo!
Bei meinem /admins wird nicht angezeigt ob der User Online ist sobald er online ist.
Code
public AdminList(playerid)
{
new string[512],header[2000],adminrang,name[MAX_PLAYER_NAME],onlinestatus[500];
new rows;
cache_get_row_count(rows);
for(new i=0;i<rows;i++)
{
cache_get_value_name_int(i,"Admin",adminrang);
cache_get_value_name(i,"Name",name,MAX_PLAYER_NAME);
if(adminrang > 1 && adminrang < 8)
{
GetPlayerStatus(name,onlinestatus);
format(string, sizeof(string), "%s\n%s\t%s\t%s",string, GetAdminName(adminrang), name,onlinestatus);
format(header,sizeof(header),"Rang\tName\tOnlinestatus\n%s",string);
}
}
ShowPlayerDialog(playerid, DIALOG_ADMINS, DIALOG_STYLE_TABLIST_HEADERS, "test - Team",header,"Abbrechen","");
return 1;
}
Alles anzeigen
Was ist hier falsch?
Code
stock GetPlayerStatus(const name[],out[])
{
static const status[][] = {"{FF0000}Offline","{40FF00}Online","{FF0048}AFK"};
for(new i=GetPlayerPoolSize(),n[MAX_PLAYER_NAME]; i!=-1; i--)
{
if(!IsPlayerNPC(i) || !GetPlayerName(i,n,MAX_PLAYER_NAME) || strcmp(name,n) != 0) continue;
if(SpielerDaten[i][player_AdminDienst])
{
return format(out, 32, status[1]);
}
return format(out,32,status[IsPlayerAFK(i) ? 2 : 1]);
}
return format(out,32,status[0]);
}
Alles anzeigen