What is this?
#1

I am getting this error on server log

Код:
[16:58:48] sscanf warning: Strings without a length are deprecated, please add a destination size.
[16:59:16] sscanf warning: Strings without a length are deprecated, please add a destination size.
[16:59:21] sscanf warning: Strings without a length are deprecated, please add a destination size
how to know on which line it is or what is the error?
Reply
#2

You using a string with no size...

ie:

pawn Код:
new reason;
if(sscanf(params, "s", reason))
Try:

pawn Код:
new reason[128];
if(sscanf(params, "s[128]", reason))
Reply
#3

I have fix the error by replacing this

pawn Код:
new busid,cost,payout,name[128];
if(sscanf(params,"iiis",busid,cost,payout,name))
To This

pawn Код:
if(sscanf(params,"iiis[128]",busid,cost,payout,name))
Reply
#4

Quote:
Originally Posted by Medal Of Honor team
Посмотреть сообщение
I have fix the error by replacing this

pawn Код:
new busid,cost,payout,name[128];
if(sscanf(params,"iiis",busid,cost,payout,name))
To This

pawn Код:
if(sscanf(params,"iiis[128]",busid,cost,payout,name))
Yes thats what i said

NOTE: if you have two strings the same size

ie.

pawn Код:
new busid,cost,payout,name[128],string[128];
just make one [150] so you can define the size in sccanf and it wont trip out(IDK if it does but i do it)

Like:

pawn Код:
new busid,cost,payout,name[150],string[128];

if(sscanf(params,"iiis[150]",busid,cost,payout,name))
Reply
#5

thanks for your help
Reply
#6

Quote:
Originally Posted by Medal Of Honor team
Посмотреть сообщение
thanks for your help
No problem mate
Reply
#7

Quote:
Originally Posted by Magazinez
Посмотреть сообщение
Yes thats what i said

NOTE: if you have two strings the same size

ie.

pawn Код:
new busid,cost,payout,name[128],string[128];
just make one [150] so you can define the size in sccanf and it wont trip out(IDK if it does but i do it)

Like:

pawn Код:
new busid,cost,payout,name[150],string[128];

if(sscanf(params,"iiis[150]",busid,cost,payout,name))
It wont trip out, you can make it
pawn Код:
new string[64],string2[64],string3[64],string4[64],string5[64],string6[64],level,cash;
if(!sscanf(params,"s[64]s[64]s[64]s[64]s[64]s[64]ii",string1,string2,string3,string4,string5,string6,level,cash))
Also remember, sscanf returns FALSE when it DOES finds the parameters, just like strcmp returns false when two strings match.
Reply
#8

Quote:
Originally Posted by Magazinez
Посмотреть сообщение
I thought i did when it doesnt??

How does this work?

pawn Код:
if(!sscanf
doesnt ! mean "if" is not?

so the correct way would be:

pawn Код:
if(sscanf(params, "i", id)) return SendClientMessage(playerid,0x0, "USAGE: /command [id]");
Well IDK this is how it works for me..
Yes your code is correct. It all depends what style you wanna code it with.

pawn Код:
if(!sscanf(params, "i", id))
{
// Code
    return 1;
}
else return SendClientMessage(playerid,-1,"USAGE: /command [id]");
Works aswell.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)