SA-MP Forums Archive
sscanf - 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 (/showthread.php?tid=662779)



sscanf - Kevinas100 - 11.01.2019

PHP код:
    if(sscanf(params"si"tnamedirikass)) return SendClientMessage(playerid0xFF0000"Naudojimas: /skirtidyriku [dalis vardo] [darbo id]");
    if(
dirikass == 1)
    {
        
user.dirikas[target] = 1;
        
SendClientMessage(playerid0x00FF00"Priskyrete Policijos nuovados direktoriu");
        
SendClientMessage(target0x00FF00"Jums priskyre Policijos Nuovados direktoriu");
    } 
Gives me this error in console
PHP код:
[18:01:47sscanf warningStrings without a length are deprecatedplease add a destination size
what should I do


Re: sscanf - AjaxM - 11.01.2019

if(sscanf(params, "si", tname, dirikass))

As it is a string, you should specify the string size in the SSCANF function ; example is below.

new example[30];
if(sscanf(params, "s[30]", example))

------

Add your string length. Above is just an example I provided.


Re: sscanf - Kevinas100 - 11.01.2019

Quote:
Originally Posted by AjaxM
Посмотреть сообщение
if(sscanf(params, "si", tname, dirikass))

As it is a string, you should specify the string size in the SSCANF function ; example is below.

new example[30];
if(sscanf(params, "s[30]", example))

------

Add your string length. Above is just an example I provided.
you mean like this?

PHP код:
sscanf(params"si[128]"tnamedirikass



Re: sscanf - ShadowMortar - 11.01.2019

I think it's
Код:
sscanf(params, "s[128]i", tname, dirikass)



Re: sscanf - Kevinas100 - 11.01.2019

Quote:
Originally Posted by ShadowMortar
Посмотреть сообщение
I think it's
Код:
sscanf(params, "s[128]i", tname, dirikass)
now it shows now warnings and completes only the sendclientmessage(playerid function