SSCANF Warning
#1

Код:
 sscanf warning: Strings without a length are deprecated, please add a destination size.
Код:
CMD:freeze(playerid,params[])
{
        if(pInfo[playerid][pLogged] == 1)
    {
    if(pInfo[playerid][pAdminLevel] >= 1)
	{
        if(IsPlayerConnected(playerid))
        {
    new id, grund, str[667];
    if(sscanf(params,"us",id,grund)) return SendClientMessage(playerid,COLOR_RED,"Usage: /freeze <player> <reason>");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid,COLOR_RED,"Player is not connected!");

    format(str,144,"{00CC66}» %s has been freezed! [Reason: %s]",PlayerName(id),grund);
    SendClientMessageToAll(-1,str);
    TogglePlayerControllable(id,0);
    }
    }
    	else {
		SendClientMessage(playerid,-1,""chat""COL_GRUEN" You have not the sufficient privileges to use this command.");
				}
	}
	else {
	    SendClientMessage(playerid,-1,""chat" You are not logged in!");
	    Kick(playerid);
	}
	return 1;
}
Reply
#2

pawn Код:
sscanf(params,"us[128]",id,grund)
Also change your definition of grund too - it should never be higher than 128 unless used in files or SQL queries
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)