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
#2

It's a filterscript or a gamemode?

By the way, your signature will give a warning:

Код:
OnPlayerDisconnect should return a value
Reply
#3

have u got all the plugins??
in the plugins folder?
Run time error 19 is mostly caused by missing plugins
Reply
#4

If you have 0.3d R2 Sscanf won't work because it isn't and it won't be updated for 0.3d R2. Downgrade your server to 0.3d R1 or wait for 0.3d R3
Reply
#5

u might be having sscanf plugin as well as sscanf include. use any one of it only
Reply
#6

so sorry for the delayed reply, but, I double checked that I had the plugin, downgraded the server to R1, still nothing! Any help?

EDIT: Had it working by adding sscanf to the server.cfg file.
Reply
#7

Quote:
Originally Posted by [MG]Dimi
Посмотреть сообщение
If you have 0.3d R2 Sscanf won't work because it isn't and it won't be updated for 0.3d R2. Downgrade your server to 0.3d R1 or wait for 0.3d R3
Rofl! And why can I run sscanf on 0.3d R2? Explain that!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)