Mute command error's
#1

Hi there i'm using this mute command:

Код:
public OnPlayerText(playerid, text[])        <----- (503)
{
  if(Muted[playerid] == 1)
  {
   SendClientMessage(playerid, RED, " You are muted and cannot talk. ");
   return 0;                            <----- (506)
  }
  return 1;                       <----(508)
}
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  new cmd[256];
  new tmp[256];
  new idx;
  cmd = strtok(cmdtext, idx);

  if(strcmp(cmd, " /mute ", true) == 0)
  {
   if(IsPlayerAdmin(playerid))
   {
     tmp = strtok(cmdtext, idx);
     if(!strlen(tmp)) return SendClientMessage(playerid, color, " Usage: /mute [id] ");
     new giveplayerid = strval(tmp);
     if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, color, " Player not connected ! ");
     new name[24], name2[24], str[128];
     GetPlayerName(playerid, name, 24);
     GetPlayerName(giveplayerid, name2, 24);
     format(str, sizeof str, " Administrator %s has muted %s ", name, name2);
     SendClientMessageToAll(color, str);
     Muted[giveplayerid] = 1;
     return 1;
   }
   else return SendClientMessage(playerid, color, " Not an administrator! ");
  }
  return 0;
}
But i've have these 3 errors:

Код:
(503)error 010: invalid function or declaration
(506)error 010: invalid function or declaration
(508)error 010: invalid function or declaration

Whats wrong?
Reply
#2

at the top of your script add [new]new Muted[MAX_PLAYERS];[/pawn]
Reply
#3

It would say undefined if he didn't create a new var.

Check your brackets jaksimaksi, I reckon you've kept one open, so the script reads the callbacks as part of the previous function. { }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)