Hallo
Also ich möchte beim /o Chat die farben von dem admins ändern.. Also das Admins zb rote farbe haben wenn sie schreiben beim /o
Wie muss ich das jetzt ändern??
if(strcmp(cmd, "/ooc", true) == 0 || strcmp(cmd, "/o", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "Du bist noch nicht eingeloggt!");
return 1;
}
if ((noooc) && PlayerInfo[playerid][pAdmin] < 1)
{
SendClientMessage(playerid, COLOR_GRAD2, "Der OOC-Kanal ist von einem Admin deaktiviert worden!");
return 1;
}
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "Du kannst nicht sprechen, da du zum Schweigen gebracht worden bist!");
return 1;
}
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, "Benutzung: (/o)oc [OOC-Chat]");
return 1;
}
if(PlayerInfo[playerid][pAdmin] >= 1338)
{
format(string, sizeof(string), "(( Server-Owner %s: %s ))", sendername, result);
}
if(PlayerInfo[playerid][pAdmin] == 1337)
{
format(string, sizeof(string), "(( Server-Manager %s: %s ))", sendername, result);
}
if(PlayerInfo[playerid][pAdmin] == 4)
{
format(string, sizeof(string), "(( Super-Admin %s: %s ))", sendername, result);
}
if(PlayerInfo[playerid][pAdmin] == 3)
{
format(string, sizeof(string), "(( Admin %s: %s ))", sendername, result);
}
if(PlayerInfo[playerid][pAdmin] == 2)
{
format(string, sizeof(string), "(( Moderator %s: %s ))", sendername, result);
}
if(PlayerInfo[playerid][pSupporter] == 1)
{
format(string, sizeof(string), "(( Supporter %s: %s ))", sendername, result);
}
OOCOff(COLOR_OOC,string);
printf("OOC-Chat: %s", string);
}
return 1;
}
//EDIT:
Bitte beim /a (chat) auch die Farbe ändern also ich will das bei /a auch die Farbe geändert wird wie muss ich das machen??
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] >= 1338)
{
format(string, sizeof(string), "*** Server-Owner %s [ID %d]: %s", sendername, playerid, result);
}
else if(PlayerInfo[playerid][pAdmin] >= 1337)
{
format(string, sizeof(string), "*** Server-Manager %s [ID %d]: %s", sendername, playerid, result);
}
else if(PlayerInfo[playerid][pAdmin] >= 4)
{
format(string, sizeof(string), "*** Super-Admin %s [ID %d]: %s", sendername, playerid, result);
}
else if(PlayerInfo[playerid][pAdmin] >= 3)
{
format(string, sizeof(string), "*** Admin %s [ID %d]: %s", sendername, playerid, result);
}
else if(PlayerInfo[playerid][pAdmin] >= 2)
{
format(string, sizeof(string), "*** Moderator %s [ID %d]: %s", sendername, playerid, result);
}
else if(PlayerInfo[playerid][pSupporter] >= 1)
{
format(string, sizeof(string), "*** Supporter %s [ID %d]: %s", sendername, playerid, result);
}
else return 1;
for(new i=0; i<GetMaxPlayers(); i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pAdmin] >= 1)
{
SendClientMessage(i,COLOR_YELLOW,string);
}
}
}
printf("A-Chat %s: %s", sendername, result);
}
return 1;
}