SA-MP Forums Archive
Sscanf warning: Strings without a length are deprecated, please add a destination size. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Sscanf warning: Strings without a length are deprecated, please add a destination size. (/showthread.php?tid=608813)



Sscanf warning: Strings without a length are deprecated, please add a destination size. - KONTROWKEN - 05.06.2016

Код:
dcmd_local(playerid, params[])
{
		new ism[300];
		new msg[300];
		new string[400];
		GetPlayerName(playerid,ism,sizeof(ism));
		if(sscanf(params, "sbh", msg)) return BilgiMesaj(playerid,"{FFFFFF}Kullanımı {99FF00}/local [Mesajınız]");
		if(strlen(msg) < 1 || strlen(msg) > 300) return HataMesaj(playerid,"Mesajın зok uzun veya зok kısa.!!!");
		format(string,sizeof(string),"{FFFFFF}[{00A8FF}LOCAL{FFFFFF}] {00A8FF}%s : {FFFFFF}%s", ism, msg);
        printf("[LOCAL]%s: %s",ism,msg);
new
      Float: pPos[3]
   ;
   GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);

   for(new i, j = GetMaxPlayers(); i != j; ++i)
   {
      if(IsPlayerConnected(i) && !IsPlayerNPC(i))
      {
     if(IsPlayerInRangeOfPoint(i, 50.0, pPos[0], pPos[1], pPos[2]))
         {
		 SendClientMessage(i, COLOR_WHITE, string);
         }
	  }
   }
		return 1;
}
dcmd_l(playerid, params[])
{
	return dcmd_local(playerid, params);
}



Re: [HELP] Sscanf warning: Strings without a length are deprecated, please add a destination size. - Infinity - 05.06.2016

Have you read the actual error...? What do you think it means?


Re: [HELP] Sscanf warning: Strings without a length are deprecated, please add a destination size. - Lucky13 - 05.06.2016

Change this
Код:
if(sscanf(params, "sbh", msg))
To:

Код:
if(sscanf(params, "s[300]", msg))