SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 11/01/2019, 04:03 PM   #1
Kevinas100
Little Clucker
 
Join Date: Oct 2015
Posts: 27
Reputation: 7
Default sscanf

PHP Code:
    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 Code:
[18:01:47sscanf warningStrings without a length are deprecatedplease add a destination size
what should I do
Kevinas100 is offline   Reply With Quote
Old 11/01/2019, 04:31 PM   #2
AjaxM
Big Clucker
 
AjaxM's Avatar
 
Join Date: May 2016
Posts: 161
Reputation: 25
Default Re: sscanf

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.
__________________

CALL OF DUTY: GHOSTS - Website | Forum | IP: 5.196.143.99:7797
AjaxM is offline   Reply With Quote
Old 11/01/2019, 04:34 PM   #3
Kevinas100
Little Clucker
 
Join Date: Oct 2015
Posts: 27
Reputation: 7
Default Re: sscanf

Quote:
Originally Posted by AjaxM View Post
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 Code:
sscanf(params"si[128]"tnamedirikass
Kevinas100 is offline   Reply With Quote
Old 11/01/2019, 04:41 PM   #4
ShadowMortar
Big Clucker
 
Join Date: Jul 2016
Posts: 60
Reputation: 5
Default Re: sscanf

I think it's
Code:
sscanf(params, "s[128]i", tname, dirikass)
ShadowMortar is online now   Reply With Quote
Old 11/01/2019, 05:04 PM   #5
Kevinas100
Little Clucker
 
Join Date: Oct 2015
Posts: 27
Reputation: 7
Default Re: sscanf

Quote:
Originally Posted by ShadowMortar View Post
I think it's
Code:
sscanf(params, "s[128]i", tname, dirikass)
now it shows now warnings and completes only the sendclientmessage(playerid function
Kevinas100 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SSCANF Warning [Help] (sscanf warning: Invalid data length.) rajabilal555 Scripting Help 1 21/06/2016 12:14 PM
[HELP]Is it possible? To Color Embed in SSCANF? Maybe SSCANF Bug/ISSUE? Guest4390857394857 Scripting Help 15 30/07/2014 05:11 AM
sscanf & zcmd help..! sscanf inside strcmp PaulDinam Scripting Help 2 26/02/2013 01:47 PM
help !! sscanf - sscanf error: System not initialised. zod23 Scripting Help 2 03/08/2012 10:14 AM
sscanf - sscanf error: System not initialised. Deal-or-die Scripting Help 5 26/06/2012 03:44 PM


All times are GMT. The time now is 08:31 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.