sscanf
#1

PHP код:
    if(sscanf(params, "si", tname, dirikass)) return SendClientMessage(playerid, 0xFF0000, "Naudojimas: /skirtidyriku [dalis vardo] [darbo id]");
    if(
dirikass == 1)
    {
        
user.dirikas[target] = 1;
        
SendClientMessage(playerid, 0x00FF00, "Priskyrete Policijos nuovados direktoriu");
        
SendClientMessage(target, 0x00FF00, "Jums priskyre Policijos Nuovados direktoriu");
    } 
Gives me this error in console
PHP код:
[18:01:47] sscanf warning: Strings without a length are deprecated, please add a destination size. 
what should I do
Reply
#2

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.
Reply
#3

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]", tname, dirikass) 
Reply
#4

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

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)