SA-MP Forums Archive
Strings not displaying - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Strings not displaying (/showthread.php?tid=585927)



Strings not displaying - Luke_James - 17.08.2015

The strings for Issued To, Issued By and Issue Date are not displaying and I can't understand why. My SQL is correct and they are saving absolutely fine when I use the /givelicense command...



PHP код:
CMD:showlicense(playeridparams[])
{
    static
        
userid;
    if (
sscanf(params"u"userid))
        return 
SendSyntaxMessage(playerid"/showlicense [playerid/name]");
    if (
userid == INVALID_PLAYER_ID || !IsPlayerNearPlayer(playeriduserid5.0))
        return 
SendErrorMessage(playerid"That player is disconnected or not near you.");
    
SendClientMessageEx(useridCOLOR_GREY"|_______________Vehicle Licenses_______________|");
    if (
Inventory_HasItem(playerid"Driving License")) SendClientMessageEx(useridCOLOR_WHITE"GVL-1 {33CC33}OBTAINED)");
     else 
SendClientMessageEx(useridCOLOR_WHITE"GVL-1 {AA3333}NOT OBTAINED");
    
SendClientMessageEx(useridCOLOR_GREY"|_______________Firearms License _______________|");
    if (
Inventory_HasItem(playerid"Weapon License"))
    {
        
SendClientMessage(useridCOLOR_WHITE"Firearms License - {33CC33}OBTAINED");
        
SendClientMessageEx(useridCOLOR_WHITE"Issued To: %s"LicenseData[playerid][licenseOwner]);
        
SendClientMessageEx(useridCOLOR_WHITE"Issued By: %s"LicenseData[playerid][licenseIssuer]);
        
SendClientMessageEx(useridCOLOR_WHITE"Issue Date: %s"LicenseData[playerid][licenseDate]);
    }
    else if (!
Inventory_HasItem(playerid"Weapon License"))
    {
        
SendClientMessage(useridCOLOR_WHITE"Firearms License - {AA3333}NOT OBTAINED");
    }
    
SendNearbyMessage(playerid30.0COLOR_PURPLE"%s takes out their licenses and shows them to %s."ReturnName(playerid0), ReturnName(userid0));
    return 
1;

This is the code that loads licenses...
PHP код:
        case THREAD_LOAD_LICENSES:
        {
            
cache_get_data(rowsfieldsg_iHandle);
            
            for (new 
0rows && MAX_LICENSES++) {
                   
cache_get_field_content(i"issueDate"LicenseData[extraid][i][licenseDate], g_iHandle128);
                   
cache_get_field_content(i"ownerID"LicenseData[extraid][i][licenseOwner], g_iHandle128);
                   
cache_get_field_content(i"issuerID"LicenseData[extraid][i][licenseIssuer], g_iHandle128);
                   
                
LicenseData[extraid][i][licenseID] = cache_get_field_int(i"licID");
            }
        } 
This is the code that saves them
PHP код:
SQL_SaveLicenses(playerid)
{
    if (!
PlayerData[playerid][pLogged])
        return 
0;
    static
        
query[256];
        
    
format(querysizeof(query), "UPDATE `licenses` SET `licID` = '%d', `ownerID` = '%s', `issuerID` = '%s', `issueDate` = '%s' WHERE `ID` = '%d'",
        
LicenseData[playerid][licenseID],
        
LicenseData[playerid][licenseOwner],
        
LicenseData[playerid][licenseIssuer],
        
LicenseData[playerid][licenseDate]
    );
    
mysql_function_query(g_iHandlequeryfalse"""");
    return 
1;

and this is the part of the /givelicense command that inserts the data into the columns
PHP код:
    static
        
query[248];
     
format(querysizeof(query), "INSERT INTO `licenses` (`ownerID`, `issuerID`, `issueDate`) VALUES('%s', '%s', '%s')"ReturnName(userid), ReturnName(playerid), ReturnDate());
    
mysql_function_query(g_iHandlequeryfalse""""); 



Re: Strings not displaying - Luke_James - 17.08.2015

Anyone?


Re: Strings not displaying - Keyhead - 17.08.2015

Is it simply showing nothing or showing the wrong data in the wrong slot?


Re: Strings not displaying - Luke_James - 17.08.2015

Quote:
Originally Posted by Keyhead
Посмотреть сообщение
Is it simply showing nothing or showing the wrong data in the wrong slot?
It's showing nothing


Re: Strings not displaying - Luke_James - 18.08.2015

Anyone?


Re: Strings not displaying - Luke_James - 18.08.2015

May as well bump again