SA-MP Forums

SA-MP Forums (https://forum.sa-mp.com/index.php)
-   Scripting Help (https://forum.sa-mp.com/forumdisplay.php?f=12)
-   -   Help me Mysql (https://forum.sa-mp.com/showthread.php?t=667851)

Libbyphay 10/07/2019 08:18 AM

Help me Mysql
 
PHP Code:

forward Characters_Menu(playerid);
public 
Characters_Menu(playerid)
{
    new 
str[64], dialog[512], C_IDC_LVLC_Name[32];

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

    for( new 
id 0id cache_num_rows(); id++)
    {
        
cache_get_value(id"ID"C_ID);
        
cache_get_value(id"Name"C_Name32);
        
cache_get_value(id"Level"C_LVL);

        
format(strsizeof(str), "[%d] \t%s\t%d\n"C_IDC_NameC_LVL);
        
strcat(dialogstrsizeof(dialog));
    }

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

    
format(strsizeof(str), "%s's Characters"Account[playerid][Name]);
    
Dialog_Show(playeridCharacter_SelectDIALOG_STYLE_TABLIST_HEADERSstrdialog"Select","Leave");

    return 
1;


PHP Code:

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

HTML Code:

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

Re: Help me Mysql
 
Someone help me

Libbyphay 10/07/2019 09:40 AM

Re: Help me Mysql
 
The Gamemode Small Country RolePlay can't use mysql R41-4?

Symon 10/07/2019 09:45 AM

Re: Help me Mysql
 
cache_get_value_int

Libbyphay 10/07/2019 09:50 AM

Re: Help me Mysql
 
Quote:

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"
Quote:

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

Re: Help me Mysql
 
Quote:

Originally Posted by KeyOfKey (Post 4105555)
cache_get_value_int

PHP Code:

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

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

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

    for( new 
id 0id cache_num_rows(); id++)
    {
        
C_ID cache_get_value_int(id"ID"Character[playerid][ID]);
        
cache_get_value(id"Name"C_Name24);
        
C_LVL cache_get_value_int(id"Level"Character[playerid][Level]);

        
format(strsizeof(str), "[%d] \t%s\t%d\n"C_IDC_NameC_LVL);
        
strcat(dialogstrsizeof(dialog));
    }

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

    
format(strsizeof(str), "%s's Characters"Account[playerid][Name]);
    
Dialog_Show(playeridCharacter_SelectDIALOG_STYLE_TABLIST_HEADERSstrdialog"Select","Leave");

    return 
1;


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

Libbyphay 10/07/2019 10:25 AM

Re: Help me Mysql
 
I Fixed, tks bro so much.


All times are GMT. The time now is 08:10 PM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.