Save a value in a Dialog [+REP]
#5

Код:
new str[5], id;
new string[58] = "Lottery ID: 492 | Started By: Forum_Samp | Date: 11/22/33";
new pos = strfind(string, " |");
strmid(str, string, 12, pos);
id = strval(str);

printf("ID: %i", id);
Here's an example of doing it using the native string functions.

EDIT: Konstantinos already posted, didn't refresh the page.
I'm not sure if there's a huge speed difference to be honest.
(I know sscanf is going to be faster, I don't know by how much though)

EDIT 2: The difference really started showing when it ran more than 10000000 times.
Reply


Messages In This Thread
Save a value in a Dialog [+REP] - by Amit1998 - 20.05.2016, 15:58
Re: Save a value in a Dialog [+REP] - by Nero_3D - 20.05.2016, 16:00
Re: Save a value in a Dialog [+REP] - by Amit1998 - 20.05.2016, 16:15
Re: Save a value in a Dialog [+REP] - by Konstantinos - 20.05.2016, 16:19
Re: Save a value in a Dialog [+REP] - by Stinged - 20.05.2016, 16:24
Re: Save a value in a Dialog [+REP] - by Amit1998 - 20.05.2016, 16:43
Re: Save a value in a Dialog [+REP] - by Konstantinos - 20.05.2016, 16:45
Re: Save a value in a Dialog [+REP] - by Amit1998 - 20.05.2016, 17:06
Re: Save a value in a Dialog [+REP] - by Konstantinos - 20.05.2016, 17:09
Re: Save a value in a Dialog [+REP] - by PrO.GameR - 20.05.2016, 19:17

Forum Jump:


Users browsing this thread: 1 Guest(s)