SA-MP Forums Archive
Loading Function - 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: Loading Function (/showthread.php?tid=621693)



Loading Function - Micko123 - 13.11.2016

This function
PHP код:
forward OrgsLoad();
public 
OrgsLoad()
{
    new 
rows cache_num_rows();
    if(
rows)
    {
        for(new 
irowsi++)
        {
            
cache_get_value_int(i"ID"OrgInfo[i][oID]);
            
cache_get_value_name(i"Name"OrgInfo[i][oName]);
            
cache_get_value_name(i"Leader"OrgInfo[i][oLeader]);
            
cache_get_value_float(i"ExitX"OrgInfo[i][oExitX]);
            
cache_get_value_float(i"ExitY"OrgInfo[i][oExitY]);
            
cache_get_value_float(i"ExitZ"OrgInfo[i][oExitZ]);
            
cache_get_value_float(i"IntX"OrgInfo[i][oIntX]);
            
cache_get_value_float(i"IntY"OrgInfo[i][oIntY]);
            
cache_get_value_float(i"IntZ"OrgInfo[i][oIntZ]);
            
cache_get_value_int(i"VW"OrgInfo[i][oVW]);
            
cache_get_value_int(i"Interior"OrgInfo[i][oInt]);
            
Iter_Add(i_Orgsi);
            new 
string[128], string2[128];
            
OrgPickup[i] = CreateDynamicPickup(13141OrgInfo[i][oExitX], OrgInfo[i][oExitY], OrgInfo[i][oExitZ]);
            
format(stringsizeof(string), ""SERVERBLUE" - %s -\n"SERVERBLUE"Leader: "WHITE"%s\n"SERVERBLUE"To enter press 'F' or 'ENTER'"OrgInfo[i][oName], OrgInfo[i][oLeader]);
            
Org3D[i] = CreateDynamic3DTextLabel(string0x1D9F00AAOrgInfo[i][oExitX], OrgInfo[i][oExitY], OrgInfo[i][oExitZ], 25.0___00__);
            
OrgExitPickup[i] = CreateDynamicPickup(13141OrgInfo[i][oIntX], OrgInfo[i][oIntY], OrgInfo[i][oIntZ], OrgInfo[i][oVW], OrgInfo[i][oInt]);
            
format(string2sizeof(string2), ""SERVERBLUE" - %s -\n"WHITE"To exit press 'F' or 'ENTER'"OrgInfo[i][oName]);
            
OrgExit3D[i] = CreateDynamic3DTextLabel(string20x1D9F00AAOrgInfo[i][oIntX], OrgInfo[i][oIntY], OrgInfo[i][oIntZ], 10.0___OrgInfo[i][oVW], OrgInfo[i][oInt], __);
        }
    }
    return 
1;

Is for loading orgs. But problem is that it won't load org name and leader.. It just leaves blank space there.. It is saving them perfectly.. Any ideas


Re: Loading Function - Micko123 - 13.11.2016

FIXED. I just added this
PHP код:
cache_get_value_name(i"Name"OrgInfo[i][oName], 50); 
            
cache_get_value_name(i"Leader"OrgInfo[i][oLeader], 50);