SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 27/08/2017, 08:52 AM   #1
bugmenotlol
Huge Clucker
 
Join Date: Jan 2016
Location: India
Posts: 227
Reputation: 8
Default sscanf issue

hi.
i have the issue with a crack command.
code
Code:
new var1,var2,var3
if(sscanf(params)"iii",var1,var2,var3)
{
      SendClientMessage(playerid,red,"syntax wrong"):
}
else {
// it entered here
}
i am not getting any error but it always show wrongsyntax and var1,var2,var3 is numbers
anything wrong ??
thnx in advance
bugmenotlol is offline   Reply With Quote
Old 27/08/2017, 09:55 AM   #2
skuller12
Big Clucker
 
Join Date: Feb 2015
Location: Galati, Romania
Posts: 101
Reputation: 0
Default Re: sscanf issue

Solve:

Code:
if(sscanf(params, "iii", var1, var2, var3))
Example:

Code:
cmd:test(playerid, params[])
{
new id, money, n[24], str[256];
if(sscanf(params, "ui", id, money)) return SendClientMessage(playerid, -1, "/test <playerid/player name> <money>");
{
if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "* Wrong ID or name.");
GivePlayerMoney(id, money);
GetPlayerName(playerid, n, 24);
format(str, 256, "%s given you $%d.", n, money);
SendClientMessage(id, -1, str);
}
return 1;
}
skuller12 is offline   Reply With Quote
Old 27/08/2017, 12:04 PM   #3
bugmenotlol
Huge Clucker
 
Join Date: Jan 2016
Location: India
Posts: 227
Reputation: 8
Default Re: sscanf issue

it was not helpful
stil cantvmake ut work
bugmenotlol is offline   Reply With Quote
Old 27/08/2017, 12:27 PM   #4
skuller12
Big Clucker
 
Join Date: Feb 2015
Location: Galati, Romania
Posts: 101
Reputation: 0
Default Re: sscanf issue

you have "#include <sscanf2>" ?
skuller12 is offline   Reply With Quote
Old 27/08/2017, 12:50 PM   #5
bugmenotlol
Huge Clucker
 
Join Date: Jan 2016
Location: India
Posts: 227
Reputation: 8
Default Re: sscanf issue

yes it works with one var1 but does not work with var2 and var1
bugmenotlol is offline   Reply With Quote
Old 27/08/2017, 12:54 PM   #6
Dayrion
High-roller
 
Dayrion's Avatar
 
Join Date: Jan 2016
Location: France
Posts: 1,915
Reputation: 258
Default Re: sscanf issue

Quote:
Originally Posted by bugmenotlol View Post
hi.
i have the issue with a crack command.
code
Code:
new var1,var2,var3
if(sscanf(params)"iii",var1,var2,var3)
{
      SendClientMessage(playerid,red,"syntax wrong"):
}
else {
// it entered here
}
i am not getting any error but it always show wrongsyntax and var1,var2,var3 is numbers
anything wrong ??
thnx in advance
You should try something like that:
PHP Code:
if(sscanf(params"iii"var1var2var3))
    return 
SendClientMessage(playerid,red," wrong syntax"):
// other code 
__________________
actor_plus - v5.0.2
I'm a goner, somebody catch my breath,
I'm a goner, somebody catch my breath
Dayrion is offline   Reply With Quote
Old 27/08/2017, 01:56 PM   #7
skuller12
Big Clucker
 
Join Date: Feb 2015
Location: Galati, Romania
Posts: 101
Reputation: 0
Default Re: sscanf issue

show me your command complete
skuller12 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
[HELP]Is it possible? To Color Embed in SSCANF? Maybe SSCANF Bug/ISSUE? Guest4390857394857 Scripting Help 14 30/07/2014 04:11 AM
sscanf issue OpticKiller Scripting Help 3 02/06/2013 08:28 AM
SSCANF Issue Deduction Scripting Help 8 14/05/2012 05:59 AM
Sscanf ID 0 Issue Shockey HD Scripting Help 6 21/12/2011 04:08 AM
Issue with sscanf Warlock Help Archive 8 04/08/2010 04:28 PM


All times are GMT. The time now is 12:44 PM.


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