sscanf warning: Strings without a length are deprecated, please add a destination size.
#1

hey everyone,

i had this error:
pawn Код:
sscanf warning: Strings without a length are deprecated, please add a destination size.
when i used this commands:
pawn Код:
CMD:akill(playerid, params[])
{
    if(PlayerInfo[playerid][AdminLevel] >= 2)
    {
        new targetid, tname[MAX_PLAYER_NAME], reason;
        new string[128], string2[128], string3[128];
        if(sscanf(params, "us", targetid, reason)) return SendClientMessage(playerid, COLOR_YELLOW, "Correct Usage: /akill [playerid] [reason]");
        GetPlayerName(targetid, tname, sizeof(tname));
        SetPlayerHealth(targetid, 0);
        format(string, sizeof(string), "ADMIN_KILL: {FF0000}%s {00FF00}has been Killed by an Admin, Reason: {FF0000}%s", tname, reason);
        format(string2, sizeof(string2), "you have killed {FF0000}%s, {00FF00}Reason: {FF0000}%s", tname, reason);
        format(string3, sizeof(string3), "You have been Killed by an Admin, Reason: {FF0000}%s", reason);
        SendClientMessage(playerid, COLOR_GREEN, string2);
        SendClientMessage(targetid, COLOR_GREEN, string3);
        SendClientMessageToAll(COLOR_GREEN, string);
    }
    else return SendClientMessage(playerid, COLOR_RED, "ERROR: you need to be atleast Admin level 2 to use this command");
    return 1;
}
CMD:explode(playerid, params[])
{
    if(PlayerInfo[playerid][AdminLevel] >= 1)
    {
        new targetid, tname[MAX_PLAYER_NAME], reason;
        new string[128], string2[128], string3[128];
        if(sscanf(params, "us", targetid, reason)) return SendClientMessage(playerid, COLOR_YELLOW, "Correct Usage: /explode [playerid] [reason]");
        GetPlayerName(targetid, tname, sizeof(tname));
        new Float:x, Float:y, Float:z;
        GetPlayerPos(targetid, x, y, z);
        CreateExplosion(x, y, z, EXPLOSION_TYPE, 20);
        format(string, sizeof(string), "ADMIN_EXPLODE: {FF0000}%s {00FF00}has been Exploded by an Admin, Reason: {FF0000}%s", tname, reason);
        format(string2, sizeof(string2), "you have Exploded {FF0000}%s, {00FF00}Reason: {FF0000}%s", tname, reason);
        format(string3, sizeof(string3), "You have been Exploded by an Admin, Reason: {FF0000}%s", reason);
        SendClientMessage(playerid, COLOR_GREEN, string2);
        SendClientMessage(targetid, COLOR_GREEN, string3);
        SendClientMessageToAll(COLOR_GREEN, string);
    }
    else return SendClientMessage(playerid, COLOR_RED, "ERROR: you need to be atleast Admin level 1 to use this command");
    return 1;
}
but i have the string length set to 128 right? string[128]...

anyways wut do i do wrong here?

i dont want warnings/errors in my scripts/console, so i wanna get rid of this one too

greets niels
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)