Hallo,
mein /a geht nicht richtig.
Undzwar können nur die Projektleiter im /a Chat schreiben.
Aber ich will das die anderen Ränge das auch können.
Befehl:
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][pAdmin] >= 1)
{
format(string, sizeof(string), "*%d Probe-Supporter %s[%d]: %s", PlayerInfo[playerid][pAdmin], sendername, playerid, result);
}
if(PlayerInfo[playerid][pAdmin] >= 2)
{
format(string, sizeof(string), "*%d Supporter %s[%d]: %s", PlayerInfo[playerid][pAdmin], sendername, playerid, result);
}
if(PlayerInfo[playerid][pAdmin] >= 3)
{
format(string, sizeof(string), "*%d Moderator %s[%d]: %s", PlayerInfo[playerid][pAdmin], sendername, playerid, result);
}
if(PlayerInfo[playerid][pAdmin] >= 4)
{
format(string, sizeof(string), "*%d Probe-Admin %s[%d]: %s", PlayerInfo[playerid][pAdmin], sendername, playerid, result);
}
if(PlayerInfo[playerid][pAdmin] >= 5)
{
format(string, sizeof(string), "*%d Admin %s[%d]: %s", PlayerInfo[playerid][pAdmin], sendername, playerid, result);
}
if(PlayerInfo[playerid][pAdmin] >= 6)
{
format(string, sizeof(string), "*%d Projektleiter %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][pSupporter] >= 1 || PlayerInfo[i][pAdmin] >= 1)
{
SendClientMessage(i,COLOR_YELLOW,string);
}
}
}
Log("OA-Chat.txt",string);
}
return 1;
}
LG
MysteriX