SA-MP Forums Archive
string not loading - 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: string not loading (/showthread.php?tid=616087)



string not loading - justjamie - 31.08.2016

title.

PHP код:
enum HouseInfo
{
    
HouseNumber,
    
hOwner[35],
    
hLocation[35],
    
Float:hX,
    
Float:hY,
    
Float:hZ,
}
new 
House[200][HouseInfo]; 
PHP код:
forward LoadHouses();
public 
LoadHouses()
{
    if(!
cache_num_rows()) return 1;
    new 
string[200];
    for(new 
i=0i<cache_get_row_count(); i++)
        {
            
House[i][HouseNumber] = cache_get_field_content_int(i,"hID");
            
cache_get_field_content(i,"hOwner",House[i][hOwner]);
            
cache_get_field_content(i,"hLocation",House[i][hLocation]);
            
House[i][hX] = cache_get_field_content_float(i,"hX");
            
House[i][hY] = cache_get_field_content_float(i,"hY");
            
House[i][hZ] = cache_get_field_content_float(i,"hZ");
            
format(string,sizeof(string),"(%i) %s's House - %s",House[i][HouseNumber],House[i][hOwner],House[i][hLocation]);
            
Create3DTextLabel(string,-1,House[i][hX],House[i][hY],House[i][hZ],20,0,0);
        }
    return 
1;




Re: string not loading - MrViolence101 - 31.08.2016

Can you please explain a bit more what the problem is.
Like what string etc.


Re: string not loading - Konstantinos - 31.08.2016

https://sampwiki.blast.hk/wiki/MySQL/R33..._field_content

Read the Important Note.


Re: string not loading - justjamie - 31.08.2016

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
hOwner[35],
hLocation[35],

im doing that, right?


Re: string not loading - PrO.GameR - 31.08.2016

PHP код:
            cache_get_field_content(i,"hLocation",House[i][hLocation], 135); 
That note means sizeof doesn't work and you need to add that parameter manually like this ^^