Guten Tag, Leutzz,,,,
grad eben habe ich den befehl "(/a)dmin" bearbeitet und wollte das jeder Admin Level, sein eigenes Sender Text hat,
Standtart:
Level 1:
** 1 Supporter BiiGpllayer: xyz
Level 4:
** 4 Admin BiiGpllayer: xyz
Und ich wollte es so machen:
** 1 Supporter BiiGpllayer: xyz
** 2 [BCR]Supporter BiiGpllayer: xyz
** 1339 ServerOwner BiiGpllayer: xyz
Doch als ich alle Level gemacht habe,... kamm dieses Pawn Compiler library Fahler und es compilert nicht....
Script:
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, "Tipp: (/a)dmin [admin chat]");
return 1;
}
if (PlayerInfo[playerid][pAdmin] >= 1)
{
format(string, sizeof(string), "*%d Supporter %s: %s", PlayerInfo[playerid][pAdmin], sendername, result);
}
else if(PlayerInfo[playerid][pAdmin] >= 2)
{
format(string, sizeof(string), "*%d [BCR]Supporter %s: %s", PlayerInfo[playerid][pAdmin], sendername, result);
}
else if(PlayerInfo[playerid][pAdmin] >= 3)
{
format(string, sizeof(string), "*%d [BCR]Moderator %s: %s", PlayerInfo[playerid][pAdmin], sendername, result);
}
else if(PlayerInfo[playerid][pAdmin] >= 4)
{
format(string, sizeof(string), "*%d [BCR]Admin %s: %s", PlayerInfo[playerid][pAdmin], sendername, result);
}
else if(PlayerInfo[playerid][pAdmin] >= 5)
{
format(string, sizeof(string), "*%d [BCR]Mapper %s: %s", PlayerInfo[playerid][pAdmin], sendername, result);
}
else if(PlayerInfo[playerid][pAdmin] >= 1337)
format(string, sizeof(string), "*%d [BCR]SuperAdmin %s: %s", PlayerInfo[playerid][pAdmin], sendername, result);
}
else if(PlayerInfo[playerid][pAdmin] >= 1338)
format(string, sizeof(string), "*%d ServerManager %s: %s", PlayerInfo[playerid][pAdmin], sendername, result);
}
else if(PlayerInfo[playerid][pAdmin] >= 1339)
format(string, sizeof(string), "*%d ServerOwner %s: %s", PlayerInfo[playerid][pAdmin], sendername, result);
}
else return 1;
for(new i=0; i<GetMaxPlayers(); i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pAdmin] >= 1)
{
SendClientMessage(i,COLOR_YELLOW,string);
}
}
}
Log("OA-Chat.txt",string);
}
return 1;
}
Doch wenn ich 6 davon als Kommentar mache:
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, "Tipp: (/a)dmin [admin chat]");
return 1;
}
if (PlayerInfo[playerid][pAdmin] >= 1)
{
format(string, sizeof(string), "*%d Supporter %s: %s", PlayerInfo[playerid][pAdmin], sendername, result);
}
else if(PlayerInfo[playerid][pAdmin] >= 2)
{
format(string, sizeof(string), "*%d [BCR]Supporter %s: %s", PlayerInfo[playerid][pAdmin], sendername, result);
}
/* else if(PlayerInfo[playerid][pAdmin] >= 3)
{
format(string, sizeof(string), "*%d [BCR]Moderator %s: %s", PlayerInfo[playerid][pAdmin], sendername, result);
}
else if(PlayerInfo[playerid][pAdmin] >= 4)
{
format(string, sizeof(string), "*%d [BCR]Admin %s: %s", PlayerInfo[playerid][pAdmin], sendername, result);
}
else if(PlayerInfo[playerid][pAdmin] >= 5)
{
format(string, sizeof(string), "*%d [BCR]Mapper %s: %s", PlayerInfo[playerid][pAdmin], sendername, result);
}
else if(PlayerInfo[playerid][pAdmin] >= 1337)
format(string, sizeof(string), "*%d [BCR]SuperAdmin %s: %s", PlayerInfo[playerid][pAdmin], sendername, result);
}
else if(PlayerInfo[playerid][pAdmin] >= 1338)
format(string, sizeof(string), "*%d ServerManager %s: %s", PlayerInfo[playerid][pAdmin], sendername, result);
}
else if(PlayerInfo[playerid][pAdmin] >= 1339)
format(string, sizeof(string), "*%d ServerOwner %s: %s", PlayerInfo[playerid][pAdmin], sendername, result);
}*/
else return 1;
for(new i=0; i<GetMaxPlayers(); i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pAdmin] >= 1)
{
SendClientMessage(i,COLOR_YELLOW,string);
}
}
}
Log("OA-Chat.txt",string);
}
return 1;
}
Kommt kein Fehler, Ich denke es liegt an den Zeilen aber anderre seits verändert sich der Zeile nicht mit oder ohne zeile sind es: 34907 ....
Ich bitte euch um Hile....
Bitte ignoriert den Rechtschreibfehlern, bin grad müde.......
Mfg BiiGpllayer