Hey.
Leider klappt irgendwas mit meinem Admin Chat nicht, ich weiß nur nicht was ... Eventuell erkennt es ja einer von euch.
Der Fehler: Wenn jemand was schreibt kommt z.b. "Serverleiter:" aber es wird nicht angezeigt was er schreibt.
Danke im Voraus
if(strcmp(cmd, "/admin", true) == 0 || strcmp(cmd, "/a", true) == 0)
{
if(IsPlayerConnected(playerid))
{
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: (/a)dmin [admin chat]");
return 1;
}
if(PlayerInfo[playerid][pSupporter] >= 1)
{
format(string, sizeof(string), "Supporter %s[%d]: %s", PlayerInfo[playerid][pSupporter], sendername, playerid, result);
}
else if(PlayerInfo[playerid][pAdmin] <= 5)
{
format(string, sizeof(string), "Administrator %s[%d]: %s", PlayerInfo[playerid][pSupporter], sendername, playerid, result);
}
else if(PlayerInfo[playerid][pAdmin] == 1338)
{
format(string, sizeof(string), "Lead Admin %s[%d]: %s", PlayerInfo[playerid][pSupporter], sendername, playerid, result);
}
else if(PlayerInfo[playerid][pAdmin] == 1339)
{
format(string, sizeof(string), "Servermanager %s[%d]: %s", PlayerInfo[playerid][pSupporter], sendername, playerid, result);
}
else if(PlayerInfo[playerid][pAdmin] == 2000)
{
format(string, sizeof(string), "Serverleiter %s[%d]: %s", PlayerInfo[playerid][pSupporter], sendername, playerid, result);
}
else return 1;
for(new i=0; i<GetMaxPlayers(); i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pSupporter] >= 1 || PlayerInfo[i][pAdmin] >= 1)
{
SendClientMessage(i,COLOR_YELLOW,string);
}
}
}
Log("OA-Chat.txt",string);
}
return 1;
}
MfG