Need help with mysql (syntax) again
#1

I need help with mysql syntax to update my mysql version to version r41-2

I can't compile these:
forward OnLoadFishingData(playerid);
public OnLoadFishingData(playerid)
{
if(cache_num_rows())
{
cache_get_value_name_int(0,"fishingRod", player_FishingData[playerid][fishingRod]);
cache_get_value_name_int(0,"fishingBait", player_FishingData[playerid][fishingBait]);
cache_get_value_name_int(0,"fishingFloat", player_FishingData[playerid][fishingFloat]);
cache_get_value_name_int(0,"fishesCaughtToday", PlayerDB[playerid][fishesCaughtToday]);
cache_get_value_name_int(0,"fishesMoneyToday", PlayerDB[playerid][fishesMoneyToday]);
for(new t = 0; t < MAX_FISH_TYPES; t++)
{
player_FishingData[playerid][fishCount][t] = cache_get_value_name(0,f("fishCount%d", t));
player_FishingData[playerid][fishAmount][t] = cache_get_value_name(0,f("fishAmount%d", t));
player_FishingData[playerid][fishBiggestSize][t] = cache_get_value_name(0,f("fishBiggestSize%d", t));

}
return true;
} it says:
PHP Code:
warning 202number of arguments does not match definition
warning 202
number of arguments does not match definition
warning 202
number of arguments does not match definition 
Reply
#2

Someone can help me?
Reply
#3

Why are you using cache_get_value_name?

Anyway, if you're on the latest version, this is how you cache_get_value_name:

pawn Code:
new dest[128];
cache_get_value_name(0, "name", dest);
printf("The value in the column 'name' is '%s'.", dest);
Reply
#4

Quote:
Originally Posted by Kane_
View Post
Why are you using cache_get_value_name?

Anyway, if you're on the latest version, this is how you cache_get_value_name:

pawn Code:
new dest[128];
cache_get_value_name(0, "name", dest);
printf("The value in the column 'name' is '%s'.", dest);
I can't understand... I changed this line:
pawn Code:
player_FishingData[playerid][fishBiggestSize][t] = cache_get_value_name_int(0,f("fishBiggestSize%d",   t));
to
pawn Code:
cache_get_value_name_int(t,f("fishBiggestSize%d",   player_FishingData[playerid][fishBiggestSize][t]));
but still get same error.
Reply
#5

mysql r41-2?

shouldn't it be like this?
PHP Code:
cache_get_value(0"name"PlayerData[playetid][name], MAX_NAME); 
Reply
#6

Quote:
Originally Posted by JesterlJoker
View Post
mysql r41-2?

shouldn't it be like this?
PHP Code:
cache_get_value(0"name"PlayerData[playetid][name], MAX_NAME); 
PHP Code:
cache_get_value_name(0"name"PlayerData[playerid][name], MAX_PLAYER_NAME); 
Hope I helped,
Reply
#7

Should this:
pawn Code:
player_FishingData[playerid][fishCount][t] = cache_get_field_content_int(0, f("fishCount%d", t));
like be this
pawn Code:
cache_get_value_name(0, "fishBiggestSize%d", player_FishingData[playerid][fishBiggestSize][t], t);
?
Reply
#8

pawn Code:
cache_get_value_name_int(0, "Kills", PlayerInfo[playerid][user_kills]);
R40+. Why do you need fishBiggestSize%d

What is "%d" doing at the end?
Reply
#9

doesn't matter if %d or it isn't it anyway says
pawn Code:
warning 213: tag mismatch
Reply
#10

you can also use format though.
Example:
PHP Code:
for(new iMAX_SIZEji++){
    new 
stringParser[2]; // 5 = 4 characters + null then 2 integers since there are only 12 slots for guns. Just an example
    
format(stringParsersize of stringParser"Guns%d"i); // parsing string from 0 to 11
    
cache_get_value(0stringParserPlayerData[playerid][guns][i]); // this might make errors, so if it does. Just add that error here. If not problem solved

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)