Simple problem with sscanf
#1

Hello,
I have returned to scripting after about 6 months and I'm having trouble with this one code,

pawn Код:
dcmd_setlevel(playerid,params[])
{
    new str[128],level; new name[24], id;

    if(sscanf(params,"ui",id,level))
        return SendClientMessage(playerid,WHITE,"Error.");

    GetPlayerName(id,name,24);
    PlayerInfo[id][Level] = level;
    UpdatePlayerFile(playerid);
    format(str,sizeof(str),"Admin %s has set your level to %d",name,level);
    SendClientMessage(id,WHITE,str);
    return 1;
}
The problem is, is that it is returning "SERVER: Unknown Command".

If I type /setlevel, I will get the message "Error", it is just when I fill out the id and level parameters I get the Unknown Command error.

Any help would be appreciated, thanks.
Reply
#2

bump
Reply
#3

Do not bump so soon! Wait at least 12 hours before bumping.

That code looks absolutely fine to me, though. Unless UpdatePlayerFile is returning 0.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)