SSCANF HELP - 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 HELP (
/showthread.php?tid=634300)
SSCANF HELP -
itachi - 16.05.2017
Код:
CMD:dann(playerid, params[])
{
AdminLevel(playerid,1)
if(sscanf(params,"s",params)) return SM(playerid, "Pouћitн: "r"/dann [ TEXT ]");
if(strlen(params) > 100) return SM(playerid, "Mod dlouhэ text");
new string[111];
TextDrawDiakritika(params);
new ID;
for(new i = 0; i < strlen(params); i++)
{
if(strfind(params[i], "~", true) == 0)
{
ID ++;
}
}
if((ID % 2) != 0) return SM(playerid,"Mбte љpatně napsanй barvy ("g"~"w") v textu");
format(string, sizeof(string), "~w~%s", params);
GameTextForAll(string, 10000, 1);
return 1;
}
log warning :
Код:
sscanf warning: Strings without a length are deprecated, please add a destination size.
sscanf warning: String buffer overflow.
Re: SSCANF HELP -
ShihabSoft - 16.05.2017
Change to this
PHP код:
sscanf(params,"s[200]",params);
Or the length you want the text to be, it's better to declare another array and fetching the values to it.
Like,
PHP код:
new str[200];
sscanf(params,"s[200]",str);
Re: SSCANF HELP -
JaKe Elite - 16.05.2017
PHP код:
if(sscanf(params,"s",params))
Can be made into this, without using sscanf
PHP код:
if(isnull(params))