SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 20/01/2012, 10:40 AM   #1801
[Nikk]
High-roller
 
[Nikk]'s Avatar
 
Join Date: Jun 2011
Location: Argentina.
Posts: 1,522
Reputation: 52
Default Respuesta: sscanf 2.0 - Fixed for 0.3d

This sscanf of the topic is for samp 0.3d R1 or R2 ?
__________________
[Nikk] is offline   Reply With Quote
Old 20/01/2012, 11:41 AM   #1802
robanswe
Huge Clucker
 
Join Date: Oct 2007
Posts: 399
Reputation: 26
Default Re: Respuesta: sscanf 2.0 - Fixed for 0.3d

Quote:
Originally Posted by [Nikk] View Post
This sscanf of the topic is for samp 0.3d R1 or R2 ?
Read the first post lazy ******.
__________________
robanswe is offline   Reply With Quote
Old 20/01/2012, 12:29 PM   #1803
[Nikk]
High-roller
 
[Nikk]'s Avatar
 
Join Date: Jun 2011
Location: Argentina.
Posts: 1,522
Reputation: 52
Default Respuesta: sscanf 2.0 - Fixed for 0.3d

From where i can get for samp 0.3 r1 ?
__________________
[Nikk] is offline   Reply With Quote
Old 20/01/2012, 01:07 PM   #1804
robanswe
Huge Clucker
 
Join Date: Oct 2007
Posts: 399
Reputation: 26
Default Re: Respuesta: sscanf 2.0 - Fixed for 0.3d

Quote:
Originally Posted by [Nikk] View Post
From where i can get for samp 0.3 r1 ?
.............In the first post.............Why do you think I told you to read it even if you should had already done so. I will not give you an link to it if you are to lazy to find it yourself in the first post then you shouldn't be using sscanf at all.
__________________
robanswe is offline   Reply With Quote
Old 20/01/2012, 01:55 PM   #1805
[Nikk]
High-roller
 
[Nikk]'s Avatar
 
Join Date: Jun 2011
Location: Argentina.
Posts: 1,522
Reputation: 52
Default Respuesta: Re: Respuesta: sscanf 2.0 - Fixed for 0.3d

Quote:
Originally Posted by robanswe View Post
.............In the first post.............Why do you think I told you to read it even if you should had already done so. I will not give you an link to it if you are to lazy to find it yourself in the first post then you shouldn't be using sscanf at all.


Stupid,

In the first post:

Quote:
Update 6

sscanf for 0.3dR2 (500 and 800 player versions):

http://www.mediafire.com/?bfp2h0d4231jjdr

Thanks to dnee`THA.
meabe you can read before say something
__________________
[Nikk] is offline   Reply With Quote
Old 20/01/2012, 02:07 PM   #1806
Y_Less
Beta Tester
 
Y_Less's Avatar
 
Join Date: Jun 2008
Location: 629 - git.io/Y
Posts: 18,447
Reputation: 2602
Default Re: sscanf 2.0 - Fixed for 0.3d

Quote:
Originally Posted by Kyosaur View Post
I think "@" would make a good specifier for this since its pretty much a public function call. It looks good, and can be justified since "@" can serve as an alternative for public function declarations :P.
I *really* like the "@" idea! Well done!

Quote:
Originally Posted by Kyosaur View Post
If you're adding these custom specifiers, are you planning only supporting integer return values? If not maybe something closer to this would be more desirable:
It doesn't actually matter, because PAWN is typeless and only has tags, you can return anything you like (Floats, ints, other) as long as they're a single cell. You may have to do this to trick the system, but it will work:

pawn Code:
SSCANF:func(string[])
{
    new Float:ret = 9.9;
    return _:ret;
}

main()
{
    new Float:x;
    sscanf("anything", "@<func>", x);
}

That should however work fine.
Y_Less is online now   Reply With Quote
Old 20/01/2012, 03:54 PM   #1807
leong124
High-roller
 
leong124's Avatar
 
Join Date: Jun 2008
Location: Hong Kong, China
Posts: 1,738
Reputation: 134
Default Re: Respuesta: Re: Respuesta: sscanf 2.0 - Fixed for 0.3d

Quote:
Originally Posted by [Nikk] View Post
Stupid,

In the first post:



meabe you can read before say something
It has backward compatibility to 0.3d R1. Have a try.
__________________
[KDT_MS]hk_shade

Sorry for my bad English and my weakness in expressing myself.
leong124 is offline   Reply With Quote
Old 20/01/2012, 03:55 PM   #1808
Kyosaur
High-roller
 
Kyosaur's Avatar
 
Join Date: Mar 2008
Location: USA - California
Posts: 1,057
Reputation: 310
Default Re: sscanf 2.0 - Fixed for 0.3d

Quote:
Originally Posted by Y_Less View Post
I *really* like the "@" idea! Well done!



It doesn't actually matter, because PAWN is typeless and only has tags, you can return anything you like (Floats, ints, other) as long as they're a single cell. You may have to do this to trick the system, but it will work:

pawn Code:
SSCANF:func(string[])
{
    new Float:ret = 9.9;
    return _:ret;
}

main()
{
    new Float:x;
    sscanf("anything", "@<func>", x);
}

That should however work fine.
I'm glad you liked the idea . Now that im well rested i cant remember why i suggested adding return types. Either i've spent to much time in well typed languages, or i was thinking from the implementation side (amx_FindPublic, pushing args, amx_Exec, and then amx_ctof must've come to mind). Either way it was silly of me, especially when we're talking about public functions, sorry about that :P.

If you have anymore cool ideas, im all ears .
__________________
[Tutorial]: Plugin development guide.
[Tutorial]: An indepth look at binary.


Follow me on twitter for updates on all my projects.
Kyosaur is offline   Reply With Quote
Old 21/01/2012, 12:05 PM   #1809
robanswe
Huge Clucker
 
Join Date: Oct 2007
Posts: 399
Reputation: 26
Default Re: sscanf 2.0 - Fixed for 0.3d

Quote:
Originally Posted by [Nikk] View Post
Stupid,

In the first post:



meabe you can read before say something
Maybe you should have done as I said and read the first post... But your to lazy for that so here you go:


Quote:
Originally Posted by Y_Less View Post
Update 4

Full final 0.3d version. I'm getting fairly smooth at updating things now, which is good! I've also fixed the "Format specifier does not match parameter count" bug. Download source, Linux and Windows plugins here:

http://dl.dropbox.com/u/21683085/sscanf-0.3d.rar

Note that this version is for 0.3d ONLY. I removed the other code as maintaining the code to detect which was the current version was getting inefficient.
__________________
robanswe is offline   Reply With Quote
Old 21/01/2012, 12:35 PM   #1810
[Nikk]
High-roller
 
[Nikk]'s Avatar
 
Join Date: Jun 2011
Location: Argentina.
Posts: 1,522
Reputation: 52
Default Respuesta: sscanf 2.0 - Fixed for 0.3d

Well done, But that is not the first of the post how you say.
Whatever, thanks
__________________
[Nikk] 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
Macros (?) for enums/arrays MP2 Scripting Help 16 17/01/2012 08:37 PM
Enums - string arrays SuperViper Scripting Help 3 31/10/2011 11:00 AM
Arrays and enums... [MWR]Blood Scripting Help 9 23/09/2011 11:29 AM
Enums and Arrays Th3Angel Help Archive 6 15/02/2011 12:46 AM


All times are GMT. The time now is 12:22 AM.


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