[Pomoc] Admin chat

Započeo The Doctor, Januar 13, 2012, 18:31:09 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim: Stari CH
Detaljan opis problema: GameMasteri vide /admin chat. Kako da stavim da samo admini vide /a chat?
Dio skripte:    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_LIGHTBLUE, "Koristite: {FFFFFF}(/a)dmin [admin chat]");
return 1;
}
format(string, sizeof(string), "|%d %s: %s", PlayerInfo[playerid][pAdmin], sendername, result);
if (PlayerInfo[playerid][pAdmin] >= 1)
{
                if (PlayerInfo[playerid][pAdmin] >= 1)
SendAdminMessage(COLOR_LIGHTBLUE, string);
}
printf("Admin %s: %s", sendername, result);
}
return 1;
}

Neke slike/video za lakse dobivanje pomoci(neobavezno): /

probaj ovako:


if(strcmp(cmd, "/a", 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, "Koristi: /a [Admin Chat]");
            return 1;
         }
         format(string, sizeof(string), "|%d|A|%s:{FFFFFF} %s", PlayerInfo[playerid][pAdmin], sendername, result);
         if (PlayerInfo[playerid][pAdmin] >= 1)
         {
            SendAdminMessage(COLOR_LIGHTBLUE, string);
         }
         printf("Admin %s: %s", sendername, result);
      }
      return 1;
   }