Ich möchte das wenn man /a nicht da steht "7* Admin Name: Test"
Da soll stehen Projektleiter Rang 2002 "Projektleiter Name: Test"
Screen wie es aussieht:
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] >= 6)
{
format(string, sizeof(string), "*%d Projektleiter %s[%d]: %s", PlayerInfo[playerid][pAdmin], sendername, playerid, result);
}
if(PlayerInfo[playerid][pAdmin] >= 1)
{
format(string, sizeof(string), "*%d Admin %s[%d]: %s", PlayerInfo[playerid][pAdmin], sendername, playerid, result);
}
else if(PlayerInfo[playerid][pSupporter] >= 1)
{
format(string, sizeof(string), "*%d Supporter %s[%d]: %s", PlayerInfo[playerid][pSupporter], sendername, playerid, result);
}
else if(PlayerInfo[playerid][pSupporter] == 6)
{
format(string, sizeof(string), "*%d Admin %s[%d]: %s", PlayerInfo[playerid][pSupporter], sendername, playerid, result);
}
else return 1;
for(new i=0; i<GetMaxPlayers(); i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[pSupporter] >= 1 PlayerInfo[pAdmin] >= 1)
{
SendClientMessage(i,COLOR_YELLOW,string);
}
}
}
Log("OA-Chat.txt",string);
}
return 1;
}