SA-MP Forums Archive
Mysql + SScanf = efficiency - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Mysql + SScanf = efficiency (/showthread.php?tid=177139)



Mysql + SScanf = Efficiency - Cameltoe - 16.09.2010

- SScanf FTW!

Today, i discovered the efficiency of sscanf.

pawn Код:
// Heres the enum of random shit.
enum SScanfData {
    SScanfString[128],
    SScanfInteger,
    Float:SScanfFloat,
    SScanfDimension[4]
}

new SScanf[MAX_PLAYERS][SScanfData];
// Heres the actual function
function SScanfTest()
{
    for(new i; i < 1; i++)
    {
        sscanf("SScanf is an great way to work with strings, right now i'm trying to make an string exact 128 characters long lets go further!§\
        13376335§1337.13371337§1§3§3§7"
,"p<§>e<s[128]ifiiii>",SScanf[i]);
        printf("SScanfString: %s",SScanf[i][SScanfString]);
        printf("SScanfInteger: %i",SScanf[i][SScanfInteger]);
        printf("SScanfFloat: %f",SScanf[i][SScanfFloat]);
        printf("SScanfDimension: %i",SScanf[i][SScanfDimension][0]);
        printf("SScanfDimension: %i",SScanf[i][SScanfDimension][1]);
        printf("SScanfDimension: %i",SScanf[i][SScanfDimension][2]);
        printf("SScanfDimension: %i",SScanf[i][SScanfDimension][3]);
    }
}
Try that example and you will see what i mean .

I made this thread to get help about this topic, solved it myself and decided to show an example of it.
Hope someone does take advantage of this.

Quote:
Originally Posted by ******
Посмотреть сообщение
there's no way to format enums in to format - however it would be an interesting project. I was debating a new format, similar to the one in YSI but as a plugin. This would be an excellent addition.
- Indeed


Re: Mysql + SScanf = efficiency - Cameltoe - 17.09.2010

Bring this page up


Re: Mysql + SScanf = efficiency - Cameltoe - 17.09.2010

Quote:
Originally Posted by ******
Посмотреть сообщение
I assume you mean "format" in that last bit of code, not "sscanf", however no, there's no way to format enums in to format - however it would be an interesting project. I was debating a new format, similar to the one in YSI but as a plugin. This would be an excellent addition.

Anyway, I'm glad you like sscanf.
Yeah, format, sorry my english sucks .. so there is no way to format enums into formats then, Well if you one day find out you want to make this i would appreciate if you told me.

Yeah, i admire your work


Re: Mysql + SScanf = efficiency - Vince - 17.09.2010

True, it makes everything so much easier. Instead of 100 lines with strval, I now have one line with sscanf.

[This forum requires that you wait 120 seconds between posts. Please try again in 11 seconds.] <.<