[Tutorial] Updating BlueG's MySQL plugin R33+ scripts to R40
#21

Quote:
Originally Posted by eco1999
View Post
Integer is wrong;

cache_get_value_name(0, "string", dest);
new value = cache_get_value_name(0, "integer");

New;

new value;
cache_get_value_name_int(0, "integer", value);
You didn't pay attention to the entire tutorial:
Quote:

all cache_get_ functions now return their value through a reference parameter instead of returning it directly:

However, I must admit that the first post is a bit ambiguous.
Reply
#22

Quote:
Originally Posted by eco1999
View Post
Integer is wrong;

cache_get_value_name(0, "string", dest);
new value = cache_get_value_name(0, "integer");

New;

new value;
cache_get_value_name_int(0, "integer", value);
yes its the correct code

or like

PHP Code:

new value;
cache_get_value_int(0"integer"value); 
Reply
#23

Is it just me, or i have to update a thousand lines now and create over thousand variables just to make R40+ work.
Reply
#24

It's certainly not just you, I mean; this is harder than I thought it'd be, I do not comprehend somethings whilst I'm literally doing the same as described in the tutorial. Unless someone can help and/or convince me not to downgrade again to R39, I'm going to do it.
Reply
#25

Quote:
Originally Posted by Kathleen
View Post
Is it just me, or i have to update a thousand lines now and create over thousand variables just to make R40+ work.
That's why he provided regex examples so it will be easier. I converted each line myself manually and it only took a couple of minutes (literally 5 minutes for 10k lines and many mysql functions being called).

Quote:
Originally Posted by saffierr
View Post
It's certainly not just you, I mean; this is harder than I thought it'd be, I do not comprehend somethings whilst I'm literally doing the same as described in the tutorial. Unless someone can help and/or convince me not to downgrade again to R39, I'm going to do it.
I'm not sure if the log system in R39-6 which now prints the query, it still does that for warnings. You can easily find the exact line (debug info) in R40+ and it supports multiple-statements which I like a lot. I'd still prefer to be up-to-date to my plugins and be ready for new features as well.


About the "over thousands variables", it's not like you cannot create a function similar to cache_num_rows and keep it the same style:
pawn Code:
cache_get_row_int(row_idx, column_idx)
{
    new retrieved_number;
    cache_get_value_index_int(row_idx, column_idx, retrieved_number);
    return retrieved_number;
}
Reply
#26

So this? http://forum.sa-mp.com/showthread.ph...30#post3811730

In previous versions there was mysql_static.so which did that work but now? xD?
Reply
#27

Well, when i'm trying to include a_mysql_yinline i have this error:

Code:
fatal error 111: user error: You have to include the y_inline include before this one!
#include <YSI\y_inline>
#include <a_mysql_yinline>
Reply
#28

Quote:
Originally Posted by PapaSmerf
View Post
Well, when i'm trying to include a_mysql_yinline i have this error:

Code:
fatal error 111: user error: You have to include the y_inline include before this one!
#include <YSI\y_inline>
#include <a_mysql_yinline>
https://github.com/maddinat0r/samp-m...nclude#example
Reply
#29

Yes, i have that one. I updated YSI to 4.0 but now my compiler crashes.
Reply
#30

Can you create a new file and try to compile the example given so we can be sure whether the problems comes from your code or not? I actually downloaded YSI and it compiled so your code is most likely the problem.
Reply
#31

http://pastebin.com/jJ31Jr6D

Everyone can login with blah blah password

How can i fix this please?

Sorry for my english.
Reply
#32

Quote:
Originally Posted by Konstantinos
View Post
Can you create a new file and try to compile the example given so we can be sure whether the problems comes from your code or not? I actually downloaded YSI and it compiled so your code is most likely the problem.
Uhh, i did it but still not working. Look at the screen http://i.imgur.com/WrRpEG1.png.
Reply
#33

Quote:
Originally Posted by PapaSmerf
View Post
Uhh, i did it but still not working. Look at the screen http://i.imgur.com/WrRpEG1.png.
You have all archives to activate plugins mysql and called plugin in server.cfg?
Reply
#34

Quote:
Originally Posted by Eloy
View Post
You have all archives to activate plugins mysql and called plugin in server.cfg?
The problem was related to compiling and its cause is still unknown. However, using Zeex's compile patch fixes it.
Reply
#35

Quote:
Originally Posted by maddinat0r
View Post
becomes
Code:
cache_get_value_index(0, 0, dest);
new value = cache_get_value_index_int(0, 1);
Simply search-and-replace it.
You made a mistake here. Simply searching and replacing wouldn't help since cache_get_value_index_int stores the retrieved value in it's third argument.
pawn Code:
native cache_get_value_index_int(row_idx, column_idx, &destination);
native cache_get_value_index_float(row_idx, column_idx, &Float:destination);
Reply
#36

mysql_store_result(mysql);

Becomes what>?
Reply
#37


I do not understand what this is, how to replace? can someone help me?
+1 Rep
Reply
#38

You need to use another script editor like Sublime text, notepad++, etc. to find and replace using regex patterns.
Reply
#39

Quote:
Originally Posted by X337
View Post
You need to use another script editor like Sublime text, notepad++, etc. to find and replace using regex patterns.
Ohh thank.. I have

how to fix it

mysql_free_result do not support on mysql r40
Reply
#40

How would I change this without getting any warning?

pawn Code:
// before
if ( gangid == cache_get_row_int( i, 0 ) ) {
//..
}

//after
if ( gangid == cache_get_value_index_int( i, 0 ) ) {
//..
}

warning 202: number of arguments does not match definition
Haven't had time to play with it yet just started upgrading my server after a whole year.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)