SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 02/07/2012, 10:23 PM   #2401
Kar
High-roller
 
Join Date: May 2010
Location: Black Asylum
Posts: 2,829
Reputation: 271
Default Re: sscanf 2.6 - New Stable Version.

Quote:
Originally Posted by Strawhats View Post
Hmm maybe one basic question.
But how can I split a string into 2 other strings with sscanf? like the total string is 120 cells long and you want to split it in 2x 60 cells long?
pawn Code:
strmid(dest, source, START, END, sizeof(dest));

strmid(dest, source, 0, 60, sizeof(dest));
strmid(dest, source, 61, 120, sizeof(dest));
__________________

  • Are you prepared to get your wish? Twisted Metal SA-MP coming soon! Join the IRC Channel: #tm on irc.tl - @tmsamp_dev

server.lvcnr.net:7777 | samp://server.lvcnr.net:7777
www.lvcnr.net | @kcnrdev
Channel: #lvcnr on irc.tl
Kar is online now   Reply With Quote
Old 02/07/2012, 10:25 PM   #2402
[HLF]Southclaw
High-roller
 
[HLF]Southclaw's Avatar
 
Join Date: Apr 2009
Location: England
Posts: 4,380
Reputation: 897
Default Re: sscanf 2.6 - New Stable Version.

EDIT: Kar might have the better solution, I was writing my post still when his was posted!


Quote:
Originally Posted by Strawhats View Post
Hmm maybe one basic question.
But how can I split a string into 2 other strings with sscanf? like the total string is 120 cells long and you want to split it in 2x 60 cells long?
If you're just splitting in half you don't need sscanf (I don't think so anyway!)

pawn Code:
/* Using:
BigString[120]
SmallString[60]
*/


strcat(SmallString, BigString[60]); // 60 or 61?
BigString[61] = EOS; // 60 or 61?

I think that should be right, but I might be off-by-one on a cell, didn't think it through because I'm pretty tired! But you get the basic idea.


There might be (and probably is) a better way to do this however! But that's all I can think of doing at the moment
[HLF]Southclaw is offline   Reply With Quote
Old 03/07/2012, 12:37 AM   #2403
HP
Big Clucker
 
HP's Avatar
 
Join Date: Mar 2011
Posts: 126
Reputation: 3
Default Re: sscanf 2.6 - New Stable Version.

Never mind.
__________________

Last edited by HP; 03/07/2012 at 01:49 AM.
HP is offline   Reply With Quote
Old 05/07/2012, 08:25 PM   #2404
BrUn3S
Little Clucker
 
BrUn3S's Avatar
 
Join Date: Jul 2011
Posts: 16
Reputation: 0
Default Re: sscanf 2.6 - New Stable Version.

when I restart server..
server write this error: sscanf error: System not initialised.

I have the latest version and I using TK admin: http://forum.sa-mp.com/showthread.php?t=269610

why? :/
__________________
HostName: [SK/CZ][0.3d] FRAGTIME.cz | GLX-fun
Address: 91.148.0.109:7810

BrUn3S is offline   Reply With Quote
Old 05/07/2012, 10:21 PM   #2405
Mohaned Ayman
Little Clucker
 
Join Date: Jul 2012
Posts: 1
Reputation: 0
Default Re: sscanf 2.6 - New Stable Version.

For all people who have problems with file msvcr100.dll

this is what to do : 1st. remove all versions of Microsoft Visual C++ Redistributable that you have on your computer from Control Panel > Add Or Remove Programs

2nd. goto C:\Windows\System32 and delete msvcr100.dll

3rd. Install Microsoft Visual C++ Redistributable 2010

4th. Enjoy and thank me
Mohaned Ayman is offline   Reply With Quote
Old 09/07/2012, 08:53 PM   #2406
Skywrath
Little Clucker
 
Join Date: Jul 2012
Posts: 2
Reputation: 0
Default Re: sscanf 2.6 - New Stable Version.

goob job mate
Skywrath is offline   Reply With Quote
Old 10/07/2012, 03:59 PM   #2407
Shadoww5
High-roller
 
Join Date: Apr 2011
Posts: 2,196
Reputation: 61
Default Re: sscanf 2.6 - New Stable Version.

I'm using ZCMD and SSCANF:

I want when the player doesn't type the level it must be set to 3 automatically. See it:

/setlevel [id] [level] > /setlevel 48 _ > so player 48 will have level 3

Who can help me ? *0*
Shadoww5 is offline   Reply With Quote
Old 10/07/2012, 04:12 PM   #2408
[HLF]Southclaw
High-roller
 
[HLF]Southclaw's Avatar
 
Join Date: Apr 2009
Location: England
Posts: 4,380
Reputation: 897
Default Re: sscanf 2.6 - New Stable Version.

@Shadoww5: I know I replied to your PM but just in case other people are looking for the answer, I'll post here too!


You simply use the "optional" feature by using an upper-case specifier:

D(3)

Now the player won't have to type a value and if he doesn't his input will automatically be 3
[HLF]Southclaw is offline   Reply With Quote
Old 10/07/2012, 10:34 PM   #2409
djcabo
Big Clucker
 
djcabo's Avatar
 
Join Date: May 2012
Location: Capture Zone
Posts: 87
Reputation: 10
Default Re: sscanf 2.6 - New Stable Version.

+1rep!
djcabo is offline   Reply With Quote
Old 12/07/2012, 09:49 AM   #2410
KINGINA
Big Clucker
 
KINGINA's Avatar
 
Join Date: Sep 2011
Location: Where I m???
Posts: 166
Reputation: 12
Default Re: sscanf 2.6 - New Stable Version.

GUYZ I NEED HELP!
How to fix this:
Code:
[03:02:47]    Error: Function not registered: 'SSCANF_Init'
[03:02:47]    Error: Function not registered: 'SSCANF_Join'
[03:02:47]    Error: Function not registered: 'SSCANF_Leave'
[03:02:47]    Error: Function not registered: 'sscanf'
[03:02:47] Script[gamemodes/PPC_Trucking.amx]: Run time error 19: "File or function is not found"
ReP + to guy who first say how to fix it!!!
i'm using last update
KINGINA 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 02:38 PM.


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