Mysql R38 to R35 Please Help [+REP]
#1

PHP код:
stock CheckAchievements(playerid)
{
    new 
rowsfields;
    new 
Query;
    
cache_get_data(rowsfieldsMySQL);
    if(
rows)
    {
        
cache_get_field_content(0"Username"AInfo[playerid][Username], MySQL24);
        
AInfo[playerid][Ach1] = cache_get_field_content_int(0"Ach1"MySQL);
        
AInfo[playerid][Ach2] = cache_get_field_content_int(0"Ach2"MySQL);
        
AInfo[playerid][Ach3] = cache_get_field_content_int(0"Ach3"MySQL);
        
AInfo[playerid][AchsCompleted] = cache_get_field_content_int(0"AchsCompleted"MySQL);
    }
    else
    {
        
mysql_format(MySQLQuery256"INSERT INTO `"Achievements_"` (Username, Ach1, Ach2, Ach3, AchsCompleted) VALUES ('%s', '0', '0', '0', '0')"GetPName(playerid));
        
mysql_query(Query);
    }
    return 
1;

Getting Error of undefined symbol cache_get_field_content_int
due to i have r35 and its r38 so can anyone convert this r35

+rep who help me
Reply
#2

Actually cache_get_field_content_int is defined in R35.
Reply
#3

its not it r37 and r38
Reply
#4

I could give you the commits from github.com regarding this plugin, to prove I'm right, but this is not the point here (not to mention that I've used that function in R34 successfully).
Let's talk about your script. Here are my suggestions:
1. Make CheckAchievements a public function instead of stock.
pawn Код:
forward CheckAchievements(playerid);
public CheckAchievements(playerid)
{
    new rows, fields;
    new Query;
    cache_get_data(rows, fields, MySQL);
    if(rows)
    {
        cache_get_field_content(0, "Username", AInfo[playerid][Username], MySQL, 24);
        AInfo[playerid][Ach1] = cache_get_field_content_int(0, "Ach1", MySQL);
        AInfo[playerid][Ach2] = cache_get_field_content_int(0, "Ach2", MySQL);
        AInfo[playerid][Ach3] = cache_get_field_content_int(0, "Ach3", MySQL);
        AInfo[playerid][AchsCompleted] = cache_get_field_content_int(0, "AchsCompleted", MySQL);
    }
    else
    {
        mysql_format(MySQL, Query, 256, "INSERT INTO `"Achievements_"` (Username, Ach1, Ach2, Ach3, AchsCompleted) VALUES ('%s', '0', '0', '0', '0')", GetPName(playerid));
        mysql_query(Query);
    }
    return 1;
}
2. Use mysql_tquery to send a threaded query and get the result in CheckAchievements function.
pawn Код:
mysql_tquery(MySQL, <some query>, "CheckAchievements", "d", playerid);
Replace <some query> with your achievements loading query (should be a SELECT query).

Try these things. Also, Achievements_ is a #define, right? I guess it won't work otherwise.
Reply
#5

not working anyone other can please?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)