PDA

View Full Version : Help me Mysql


Libbyphay
10/07/2019, 08:18 AM
forward Characters_Menu(playerid);
public Characters_Menu(playerid)
{
new str[64], dialog[512], C_ID, C_LVL, C_Name[32];

format(str, sizeof(str), "C_ID\tCharacter Name\tLevel\n");
strcat(dialog, str, sizeof(dialog));

for( new id = 0; id < cache_num_rows(); id++)
{
cache_get_value(id, "ID", C_ID);
cache_get_value(id, "Name", C_Name, 32);
cache_get_value(id, "Level", C_LVL);

format(str, sizeof(str), "[%d] \t%s\t%d\n", C_ID, C_Name, C_LVL);
strcat(dialog, str, sizeof(dialog));
}

if(cache_num_rows() < 3)
{
format(str, sizeof(str), " \tCreate Character\t\n");
strcat(dialog, str, sizeof(dialog));
}

format(str, sizeof(str), "%s's Characters", Account[playerid][Name]);
Dialog_Show(playerid, Character_Select, DIALOG_STYLE_TABLIST_HEADERS, str, dialog, "Select","Leave");

return 1;
}

C:\Users\Administrator\Desktop\SAMP\gamemodes\SCRP-R39.pwn(1094) : error 035: argument type mismatch (argument 3)
C:\Users\Administrator\Desktop\SAMP\gamemodes\SCRP-R39.pwn(1096) : error 035: argument type mismatch (argument 3)

cache_get_value(id, "ID", C_ID);
cache_get_value(id, "Level", C_LVL);

I updated Mysql R39 to R41-4, but I can't fix it

Libbyphay
10/07/2019, 09:28 AM
Someone help me

Libbyphay
10/07/2019, 09:40 AM
The Gamemode Small Country RolePlay can't use mysql R41-4?

Symon
10/07/2019, 09:45 AM
cache_get_value_int

Libbyphay
10/07/2019, 09:50 AM
C:\Users\Administrator\Desktop\SAMP\gamemodes\SCRP-R39.pwn(1094) : error 017: undefined symbol "cache_get_value_int_ovrld"
C:\Users\Administrator\Desktop\SAMP\gamemodes\SCRP-R39.pwn(1096) : error 017: undefined symbol "cache_get_value_int_ovrld"

C_ID = cache_get_value_int(id, "ID");
cache_get_value(id, "Name", C_Name, 24);
C_LVL = cache_get_value_int(id, "Level");

No working.

Libbyphay
10/07/2019, 09:53 AM
cache_get_value_int

forward Characters_Fetch(playerid);
public Characters_Fetch(playerid)
{
new query[128];
mysql_format(SQL_CONNECTION, query, sizeof(query), "SELECT ID, Name, Level FROM Characters WHERE A_ID = '%d' LIMIT 3", Account[playerid][SQLID]);
mysql_tquery(SQL_CONNECTION, query, "Characters_Menu", "i", playerid);
return 1;
}

forward Characters_Menu(playerid);
public Characters_Menu(playerid)
{
new str[64], dialog[512], C_ID, C_Name[24], C_LVL;

format(str, sizeof(str), "C_ID\tCharacter Name\tLevel\n");
strcat(dialog, str, sizeof(dialog));

for( new id = 0; id < cache_num_rows(); id++)
{
C_ID = cache_get_value_int(id, "ID", Character[playerid][ID]);
cache_get_value(id, "Name", C_Name, 24);
C_LVL = cache_get_value_int(id, "Level", Character[playerid][Level]);

format(str, sizeof(str), "[%d] \t%s\t%d\n", C_ID, C_Name, C_LVL);
strcat(dialog, str, sizeof(dialog));
}

if(cache_num_rows() < 3)
{
format(str, sizeof(str), " \tCreate Character\t\n");
strcat(dialog, str, sizeof(dialog));
}

format(str, sizeof(str), "%s's Characters", Account[playerid][Name]);
Dialog_Show(playerid, Character_Select, DIALOG_STYLE_TABLIST_HEADERS, str, dialog, "Select","Leave");

return 1;
}

I think Characters_Fetch(playerid) no working, how to fix it?

Libbyphay
10/07/2019, 10:25 AM
I Fixed, tks bro so much.