sscanf problem
#1

pawn Код:
dcmd_setcmdlevel(playerid,params[]) {
    if(PlayerInfo[playerid][Level] >= CheckLevel("setcmdlevel"))
    {
        new cmdname[30],str[128],lvl;
        if(sscanf(params,"s[30]i",cmdname,lvl))
        {
            SendClientMessage(playerid, red, "USAGE: /setcmdlevel [command] [level]");
            return 1;
        }
        else if(CommandExist(cmdname))
        {
            for(new i;i<217;i++)
            {
                if(YHash(cmdname, false)==Cmds[i][Unique])
                {
                    Cmds[i][Level]=lvl;
                }
            }
            format(str,sizeof(str),"The required level from %s is set to %i",cmdname,lvl);
            SendClientMessage(playerid,blue,str);
            return 1;
        }
        else
        {
            format(str,sizeof(str),"Command %s is not found",cmdname);
            SendClientMessage(playerid,blue,str);
            return 1;
        }
    } else LevelError(playerid,"setcmdlevel");
    return 1;
}
when i follow the right syntax it says unknown command. but when i dont follow the syntax it says the error speciefied in the sendclientmessage. help please? it acts not the way it must act
Reply


Messages In This Thread
sscanf problem - by legodude - 19.03.2011, 11:07
Re: sscanf problem - by Biesmen - 19.03.2011, 11:19

Forum Jump:


Users browsing this thread: 1 Guest(s)