hey, ich verstehe nicht warum mein Chat nicht funktioniert?
Code
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[200];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Benutze: (/a)dmin [Text]");
return 1;
}
if (PlayerInfo[playerid][pAdmin] == 1)
{
format(string, sizeof(string), "Level 1 - Moderator %s: %s", sendername, result);
SendAdminMessage(COLOR_YELLOW, string);
}
if (PlayerInfo[playerid][pAdmin] == 2)
{
format(string, sizeof(string), "Level 2 - Moderator %s: %s", sendername, result);
SendAdminMessage(COLOR_YELLOW, string);
}
if (PlayerInfo[playerid][pAdmin] == 3)
{
format(string, sizeof(string), "Level 3 - Support Admin %s: %s", sendername, result);
SendAdminMessage(COLOR_YELLOW, string);
}
if (PlayerInfo[playerid][pAdmin] == 4)
{
format(string, sizeof(string), "Level 4 - Support Admin %s: %s", sendername, result);
SendAdminMessage(COLOR_YELLOW, string);
}
if (PlayerInfo[playerid][pAdmin] == 1337)
{
format(string, sizeof(string), "Level 1337 - Management %s: %s", sendername, result);
SendAdminMessage(COLOR_YELLOW, string);
}
if (PlayerInfo[playerid][pAdmin] == 1338)
{
format(string, sizeof(string), "Level 1338 - Projektleitung %s: %s", sendername, result);
SendAdminMessage(COLOR_YELLOW, string);
}
printf("[AdminChat] %s: %s", sendername, result);
}
return 1;
}
Alles anzeigen
wenn ich /admin eingebe kommt schon /admin text benutzen,
aber dann geht nichts