Big Sscanf problem.
#1

Hey. I'm creating my admin system, using ZCMD, and sscanf..
And, when trying to make the first command, I get this.
This is the command:
pawn Код:
CMD:makeadmin(playerid, params[])
{
    if(IsPlayerAdmin(playerid) == 1 || PlayerInfo[playerid][pAdmin] < 1338 || PlayerInfo[playerid][pCSA] == 1)
    {
    new id, name[24], str[128], level;
    GetPlayerName(id, name, 24);
    if(sscanf(params, "ui", id, level)) return SendClientMessage(playerid, COLOR_SYSTEM, "USAGE: /makeadmin <ID> <level>");
    PlayerInfo[id][pAdmin] = level;
    format(str, sizeof(str), "%s has been made a level %s.", name, level);
    }else
    {
    SendClientMessage(playerid, COLOR_SYSTEM, "You're not high enough admin-level or not an admin at all!");
     }
    return 1;
}
When trying to launch the server, I get:
pawn Код:
Script[gamemodes/MyScript.amx]: Run time error 19: "File or function is not found"
Even though it compiles fine..
I've updated sscanf to 0.3d
BUT, if I do like this:
pawn Код:
CMD:makeadmin(playerid, params[])
{
    if(IsPlayerAdmin(playerid) == 1 || PlayerInfo[playerid][pAdmin] < 1338 || PlayerInfo[playerid][pCSA] == 1)
    {
    new id, name[24], str[128], level;
    GetPlayerName(id, name, 24);
    //if(sscanf(params, "ui", id, level)) return SendClientMessage(playerid, COLOR_SYSTEM, "USAGE: /makeadmin <ID> <level>");
    PlayerInfo[id][pAdmin] = level;
    format(str, sizeof(str), "%s has been made a level %s.", name, level);
    }else
    {
    SendClientMessage(playerid, COLOR_SYSTEM, "You're not high enough admin-level or not an admin at all!");
     }
    return 1;
}
Like you can see, I've commented out the sscanf line.
now, the server starts, but ofcourse the command doesn't work.
Any help would be greatly appreciated.
Reply


Messages In This Thread
Big Sscanf problem. - by rubygta - 29.12.2011, 14:21
Re: Big Sscanf problem. - by Lуs - 29.12.2011, 14:26
Re: Big Sscanf problem. - by §с†¶e®РµРe - 29.12.2011, 14:28
Re: Big Sscanf problem. - by [MG]Dimi - 29.12.2011, 14:31
Re: Big Sscanf problem. - by THE_KNOWN - 29.12.2011, 15:05
Re: Big Sscanf problem. - by rubygta - 05.01.2012, 15:10
Re: Big Sscanf problem. - by fiki574 - 05.01.2012, 15:38

Forum Jump:


Users browsing this thread: 1 Guest(s)