Help with errors!
#1

pawn Код:
command(mute, playerid, params[])
{
    new string[128]
    new ID; //Error Line
    new pname[24]
    new aname[24]// Error line
    GetPlayerName(ID, pname, sizeof(pname));// Error line
    GetPlayerName(playerid,aname,24);
   
    if( PlayerInfo[playerid][Admin] >= 1)
    {
        if(sscanf(params, "i", ID))
        {
            SendClientMessage(playerid, COLOUR_ORANGE, "Hint: /mute (playerid)" );
            return 1;
        }
        if(!IsPlayerConnected(ID))
        {
            SendClientMessage(playerid, COLOUR_ORANGE, "Hint: Invalid Player ID");
            return 1;
        }
        format(string, sizeof(string), "%s(%d) has been muted by Admin %s", pname, ID, aname);
        SendToAdmins(ADMIN_WARNING, string);
        PlayerInfo[ID][Muted] = 1;
        SendClientMessage(ID, COLOUR_ORANGE, "You have been muted. To request to be unmuted use /muterequest" );
    }
    return 1;
}
I gave the command a go but I think I have failed! Please help me try to fix these errors.

pawn Код:
(1464) : error 001: expected token: ";", but found "new"
(1466) : error 001: expected token: ";", but found "new"
(1467) : error 001: expected token: ";", but found "-identifier-"
Reply
#2

replace your lines with these ones:
pawn Код:
new string[128];
    new ID; //Error Line
    new pname[24];
    new aname[24];// Error line
Next time, put a ; sign after almost every line.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)