SA-MP Forums Archive
[HELP]Change SQL to NO SQL! - 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: [HELP]Change SQL to NO SQL! (/showthread.php?tid=113191)



[HELP]Change SQL to NO SQL! - [NYRP]Mike. - 12.12.2009

Hey guys, i was just checking a script, Bombing Filterscript (by Mauzen) and i noticed a function here:

pawn Код:
public Float:GetGroundZ(Float:x, Float:y) {
        new rxy[96];
        x = 5.0 * floatround(x / 5.0);  //Replace all 5.0 by the MySQL "map resolution"
        y = 5.0 * floatround(y / 5.0);  //Replace all 5.0 by the MySQL "map resolution"
        format(rxy, 96, "SELECT z FROM hmap WHERE x = %d AND y = %d;", floatround(x), floatround(y));
        samp_mysql_query(rxy);
        samp_mysql_store_result();
        samp_mysql_fetch_row(rxy);
        return floatstr(rxy);
}
this is the only thing in the script using MySQL is their something in 0.3 that could maybe remove the MySQL from this as i dont really want to use MySQL but.... please help thanks.

-©un3o.


Re: [HELP]Change SQL to NO SQL! - Joe Staff - 12.12.2009

You would need another method for saving the ground map for all of San Andreas.


Re: [HELP]Change SQL to NO SQL! - [NYRP]Mike. - 12.12.2009

I know, but how could i get the x(ground level) of the map for pawn?


Re: [HELP]Change SQL to NO SQL! - mamorunl - 12.12.2009

yes. Get all the stuff from the database and put it into your script (an array or enum or some sort) then replace the stuff that he gets from mysql with your array.


Re: [HELP]Change SQL to NO SQL! - Nero_3D - 12.12.2009

Quote:
Originally Posted by -SSRT-mamoru
yes. Get all the stuff from the database and put it into your script (an array or enum or some sort) then replace the stuff that he gets from mysql with your array.
thats a bad idea, he did use 6000 * 6000 format in 10. relamination that would be 3600000 lines


Re: [HELP]Change SQL to NO SQL! - [NYRP]Mike. - 12.12.2009

well does anyone have any ideas?


Re: [HELP]Change SQL to NO SQL! - Nero_3D - 12.12.2009

Quote:
Originally Posted by ♣ ©ⓤⓝⓔⓞ ♣
well does anyone have any ideas?
another database, pawn supports files and sqlite


Re: [HELP]Change SQL to NO SQL! - [NYRP]Mike. - 12.12.2009

I know, but i'm trying not to use SQL, but i dont know how i would do it, maybe if i enter a certain co-ord like -9099999 the bomb would explode on land? :P lol well i dont have any ideas to get the ground.


Re: [HELP]Change SQL to NO SQL! - mamorunl - 13.12.2009

Quote:
Originally Posted by ♣ ⓐⓢⓢ
Quote:
Originally Posted by -SSRT-mamoru
yes. Get all the stuff from the database and put it into your script (an array or enum or some sort) then replace the stuff that he gets from mysql with your array.
thats a bad idea, he did use 6000 * 6000 format in 10. relamination that would be 3600000 lines
Do you have an english version of this?

I thought there was some sort of function to get the Z height of the map level.


Re: [HELP]Change SQL to NO SQL! - Nero_3D - 13.12.2009

Quote:
Originally Posted by -SSRT-mamoru
I thought there was some sort of function to get the Z height of the map level.
The function only read the data, making the function is easy
The hard is to get(store) the data, he saved all the high values in 10. steps

x 3000 y 3000 z (some value)
x 3000 y 2990 z (some value)
x 3000 y 2980 z (some value) ...
x 3000 y -2990 z (some value)
x 3000 y -3000 z (some value)
x 2990 y 3000 z (some value)
x 2990 y 2990 z (some value) ...
x -3000 y -3000 z (some value)

hope now you can image how big the table is
mysql was a good place for it