[HELP]Change SQL to NO SQL!
#1

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.
Reply
#2

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

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

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.
Reply
#5

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
Reply
#6

well does anyone have any ideas?
Reply
#7

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

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.
Reply
#9

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.
Reply
#10

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)