Hallo, ich habe mal ein AdminChat für Head-Admins gebastelt (ab Admin Rank 4) aber der Text kann auch von niedrigeren Admins gelesen werden. Woran liegt es das niedrieger Admins den Chat lesen können?
if(strcmp(cmd, "/hadmin", true) == 0 || strcmp(cmd, "/ha", true) == 0)
{
if(PlayerInfo[playerid][pAdmin] >= 4)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "NUTZE: (/ha)dmin [Head-Admin Chat]");
return 1;
}
if(PlayerInfo[playerid][pAdmin] >= 4)
{
format(string, sizeof(string), "*%d Head-Admin %s[%d]: %s", PlayerInfo[playerid][pAdmin], sendername, playerid, result);
}
else return 1;
for(new i=0; i<GetMaxPlayers(); i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pAdmin] >= 1)
{
SendClientMessage(i,COLOR_RED,string);
}
}
}
Log("OA-Chat.txt",string);
}
return 1;
}