sscanf Server Log Warning
#1

Hey there, I just installed sscanf on my host and everything works fine, except the "u" thing,
for players it says Non exisiting command etc
and in server.log this:

[18:29:42] RCON (In-Game): Player #0 (Milan_Huizen) has logged in.
[18:31:13] sscanf warning: Strings without a length are deprecated, please add a destination size.
Reply
#2

You have "s" must be "s[string_size]"
Reply
#3

and the "u" part?
I mean, /makeadmin isnt working as it should

pawn Код:
CMD:makeadmin(playerid, params[])
{
    new id;
    new AdminLevel2;
    if(IsPlayerConnected(id))
    {
        if(PlayerInfo[playerid][AdminLevel] >= 6 || IsPlayerAdmin(playerid))
        {
            if(!sscanf(params, "ui", id, AdminLevel2))
            {
                if((AdminLevel2 >= 1 && AdminLevel2 <= 6) || AdminLevel2 == 0)
                {
                    new string[64];
                    new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
                    GetPlayerName(playerid, name, sizeof(name));
                    GetPlayerName(id, PlayerName, sizeof(PlayerName));
                    format(string, sizeof(string), "%s Has Given You %d Admin Level.", name, AdminLevel2);
                    SendClientMessage(id, 0xD8D8D8FF, string);
                    format(string, sizeof(string), "You Gave %d Admin Level To %s .", AdminLevel2, PlayerName);
                    SendClientMessage(playerid, 0xD8D8D8FF, string);
                    PlayerInfo[id][AdminLevel] = AdminLevel2;
                    return 1;
                }
                else return SendClientMessage(playerid, 0xD8D8D8FF, "Avaliable Levels: 1, 2, 3, 4, 5 and 6.");
            }
            else return SendClientMessage(playerid, 0xD8D8D8FF, "USAGE: /makeadmin [PlayerId/PartOfName] [AdminLevel]");
        }
        else return SendClientMessage(playerid, 0xD8D8D8FF, "You Need Rcon Admin To Use This Command!");
    }
    else return SendClientMessage(playerid, 0xD8D8D8FF, "Player Is Not Connected");
}
Reply
#4

You downloaded sscanf or sscanf2 ?
Reply
#5

Quote:
Originally Posted by king_hual
Посмотреть сообщение
You downloaded sscanf or sscanf2 ?
I tried both,
I changed the code a bit now and I now just get Player Is Not connected

pawn Код:
CMD:makeadmin(playerid, params[])
{
    new id;
    new AdminLevel2;
    if(!sscanf(params, "ui", id, AdminLevel2))
    {
        if(PlayerInfo[playerid][AdminLevel] >= 6 || IsPlayerAdmin(playerid))
        {
            if(IsPlayerConnected(id))
            {
                if((AdminLevel2 >= 1 && AdminLevel2 <= 6) || AdminLevel2 == 0)
                {
                    new string[64];
                    new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
                    GetPlayerName(playerid, name, sizeof(name));
                    GetPlayerName(id, PlayerName, sizeof(PlayerName));
                    format(string, sizeof(string), "%s Has Given You %d Admin Level.", name, AdminLevel2);
                    SendClientMessage(id, 0xD8D8D8FF, string);
                    format(string, sizeof(string), "You Gave %d Admin Level To %s .", AdminLevel2, PlayerName);
                    SendClientMessage(playerid, 0xD8D8D8FF, string);
                    PlayerInfo[id][AdminLevel] = AdminLevel2;
                    return 1;
                }
                else return SendClientMessage(playerid, 0xD8D8D8FF, "Avaliable Levels: 1, 2, 3, 4, 5 and 6.");
            }
            else return SendClientMessage(playerid, 0xD8D8D8FF, "Player is not connected");
        }
        else return SendClientMessage(playerid, 0xD8D8D8FF, "You Need Rcon Admin To Use This Command!");
    }
    else return SendClientMessage(playerid, 0xD8D8D8FF, "USAGE: /makeadmin [PlayerId/PartOfName] [AdminLevel]");
}
Reply
#6

just tested and when I replace the "u" with "i" it works.
but only the ID then, not the name:/
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)