Time Mute Problem 4 Errors
#1

Hey Guys
i have a Problem with the time mute/unmute script

i became this errors:
Код:
C:\Dokumente und Einstellungen\Luffy.A-DFC86132167C4\Desktop\undeadNightmare.pwn(3090) : error 029: invalid expression, assumed zero
C:\Dokumente und Einstellungen\Luffy.A-DFC86132167C4\Desktop\undeadNightmare.pwn(3090) : warning 215: expression has no effect
C:\Dokumente und Einstellungen\Luffy.A-DFC86132167C4\Desktop\undeadNightmare.pwn(3090) : error 001: expected token: ";", but found "]"
C:\Dokumente und Einstellungen\Luffy.A-DFC86132167C4\Desktop\undeadNightmare.pwn(3090) : error 029: invalid expression, assumed zero
C:\Dokumente und Einstellungen\Luffy.A-DFC86132167C4\Desktop\undeadNightmare.pwn(3090) : fatal error 107: too many error messages on one line
the script:

pawn Код:
COMMAND:mute(playerid,params[]) {
    new
        id,
        name1[30],
        name2[30],
        time,
        timef,
        reason[50],
        text[128];
    if(sscanf(params,"uis",id,time,reason))
        return SendClientMessage(playerid,rot,"USAGE: /mute [id] [time (in mins)] [reason]");
    if(PlayerInfo[playerid][pAdminLevel] >= 2) {
        if(IsPlayerConnected(id)) {
            if(PlayerInfo[id][pAdminLevel] <= PlayerInfo[playerid][pAdminLevel]) {
                if(PlayerInfo[playerid][pMuted] == 0) {
                    GetPlayerName(playerid,name1,sizeof(name1));
                    GetPlayerName(id,name2,sizeof(name2));
                    format(text,sizeof(text),"Administrator \"%s\" has muted \"%s\" for %i minute(s). (Reason: %s)",name1,name2,time,reason);
                    SendClientMessageToAll(red,text);
                    timef = time * 60000;
                    PlayerInfo[id][pMuted] = 1;
                    new command[30];
                    format(command,sizeof(command),"unmute(%i)",id);
                    SetTimerEx("unmute",timef,false,"i",id);
                    SaveIn("mutes",text);
                } else {
                    return SendClientMessage(playerid,red,"Player is muted already.");
                }
            } else {
                return SendClientMessage(playerid,red,"You can't mute a higher level admin!");
            }
        } else {
            return SendClientMessage(playerid,red,"Invalid ID");
        }
    } else {
        return SendClientMessage(playerid,red,"Only lvl2 admins can use this command!");
    }
    return 1;
}

COMMAND:unmute(playerid,params[]) {
    new
        id,
        name1[30],
        name2[30],
        text[128];
    if(sscanf(params,"u",id))
         return SendClientMessage(playerid,rot,"USAGE: /unmute [id]");
    if(PlayerInfo[playerid][pAdminLevel] >= 2) (
        if(IsPlayerConnected(id)) {
            if(PlayerInfo[id][pAdminLevel] <= PlayerInfo[playerid][pAdminLevel]) {
                if(PlayerInfo[playerid][pMuted] == 1) {
                    GetPlayerName(playerid,name1,sizeof(name1));
                    GetPlayerName(id,name2,sizeof(name2));
                    format(text,sizeof(text),"Administrator \"%s\" has unmuted \"%s\".",name1,name2);
                    SendClientMessageToAll(red,text);
                    PlayerInfo[id][pMuted] = 0;
                    SaveIn("unmutes",text);
                } else {
                    return SendClientMessage(playerid,red,"Player is unmuted already.");
                }
            } else {
                return SendClientMessage(playerid,red,"You can't unmute a higher level admin!");
            }
        } else {
            return SendClientMessage(playerid,red,"Invalid ID");
        }
    } else {
        return SendClientMessage(playerid,red,"Only lvl2 admins can use this command!");
    }
    return 1;
}
//unmute timer:

forward unmute(id);

public unmute(id) {
    PlayerInfo[id][pMuted] = 0;
    SendClientMessage(id,COLOR_GREEN,"Your mute time is over. You can talk again :]");
}

//OnlyPlayerText:

public OnPlayerText(playerid, text[])
{
    new
        mess[128],
        name[30];
    if(PlayerInfo[playerid][pMuted] == 1) {
        if(PlayerInfo[playerid][pWarns] == 3) {
            SendClientMessage(playerid,red,"You've been kicked for being warned 3 times.");
            GetPlayerName(playerid,name,sizeof(name));
            format(mess,sizeof(mess),"%s has been kicked for exceeding mute warnings. (3)");
            SendClientMessageToAll(red,mess);
            Kick(playerid);
            return 0;
        } else {
            format(mess,sizeof(mess),"You are muted. You will get a message when your muted time is over. Warning(s): %i",PlayerInfo[playerid][pWarns]);
            SendClientMessage(playerid,red,mess);
            PlayerInfo[playerid][pWarns]++;
            return 0;
        }
    }
    return 1;
}
Thanks for help
Reply
#2

Could you tell me which line is creating all the errors for you?
Reply
#3

this:
pawn Код:
if(PlayerInfo[playerid][pAdminLevel] >= 2) {
at command mute
Reply
#4

Have you got pAdminLevel in an enum?
Reply
#5

i think no.
Reply
#6

That's your problem, you'll need an enum with all your player statistics in (admin level, money, skin etc.)
Reply
#7

sry i have a enum but this mute donґt working on my script

close pls
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)