Hey ich bekomme es einfach nicht hin das im o Chat nur Admins schreiben können
//==================================OOC=========================================
if(strcmp(cmd, "/ooc", true) == 0 || strcmp(cmd, "/o", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] == 1)
{
SendClientMessage(playerid,COLOR_GRAD2,"Der Chat ist nur für das Admin Team!");
return 1;
}
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " Du bist nicht eingeloggt!");
return 1;
}
if(PlayerInfo[playerid][pTot] == 1)
{
SendClientMessage(playerid, COLOR_GREY, "Tote können nicht Reden!");
return 0;
}
if ((noooc) && PlayerInfo[playerid][pAdmin] < 1)
{
SendClientMessage(playerid, COLOR_GRAD2, " Der /ooc Chat wurde von einem Administrator ausgeschaltet!");
return 1;
}
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, " Du kannst nicht schreiben, du bist gemutet!");
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, " (/o)oc [ooc chat]");
return 1;
}
if(GetPlayerMoney(playerid) < 0)
{
SendClientMessage(playerid, COLOR_GRAD5, "Du bist kein Admin");
return 1;
}
if(Adminmode[playerid] == 1)
{
format(string, sizeof(string), "(( Administrator %s: %s ))", sendername, result);
GivePlayerMoney(playerid, -0);
/*GameTextForPlayer(playerid, "~y~Der Chat kostet~n~~y~dich~r~ -28$",4000,1);*/
OOCOff(COLOR_OOC,string);
}
else if (Adminmode[playerid] == 1)
{
format(string, sizeof(string), "(( Administrator %s: %s ))", sendername, result);
OOCOff(COLOR_RED,string);
}
if(PlayerInfo[playerid][pLevel] < 3)
{
SendClientMessage(playerid, COLOR_GRAD5, "Du bist kein Administrator");
return 1;
}
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
printf("%s", string);
}
return 1;
}