SA-MP Forums Archive
Can you help? - 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: Can you help? (/showthread.php?tid=626620)



Can you help? - Micko123 - 17.01.2017

Does anyone sees anything wrong with this??
PHP код:
forward OrgsLoad();
public 
OrgsLoad()
{
    new 
rows cache_num_rows();
    if(
rows)
    {
        new 
index Iter_Free(i_Orgs);
         for(new 
irowsi++)
        {
            
cache_get_value_int(i"ID"OrgInfo[index][oID]);
            
cache_get_value_name(i"Name"OrgInfo[index][oName], 50);
            
cache_get_value_name(i"Leader"OrgInfo[index][oLeader], 50);
            
cache_get_value_name(i"Member1"OrgInfo[index][oMember1], 50);
            
cache_get_value_name(i"Member2"OrgInfo[index][oMember2], 50);
            
cache_get_value_name(i"Member3"OrgInfo[index][oMember3], 50);
            
cache_get_value_name(i"Member4"OrgInfo[index][oMember4], 50);
            
cache_get_value_name(i"Member5"OrgInfo[index][oMember5], 50);
            
cache_get_value_name(i"Member6"OrgInfo[index][oMember6], 50);
            
cache_get_value_name(i"Member7"OrgInfo[index][oMember7], 50);
            
cache_get_value_name(i"Member8"OrgInfo[index][oMember8], 50);
            
cache_get_value_name(i"Member9"OrgInfo[index][oMember9], 50);
            
cache_get_value_name(i"Member10"OrgInfo[index][oMember10], 50);
            
cache_get_value_float(i"ExitX"OrgInfo[index][oExitX]);
            
cache_get_value_float(i"ExitY"OrgInfo[index][oExitY]);
            
cache_get_value_float(i"ExitZ"OrgInfo[index][oExitZ]);
            
cache_get_value_float(i"IntX"OrgInfo[index][oIntX]);
            
cache_get_value_float(i"IntY"OrgInfo[index][oIntY]);
            
cache_get_value_float(i"IntZ"OrgInfo[index][oIntZ]);
            
cache_get_value_float(i"SefX"OrgInfo[index][oSefX]);
            
cache_get_value_float(i"SefY"OrgInfo[index][oSefY]);
            
cache_get_value_float(i"SefZ"OrgInfo[index][oSefZ]);
            
cache_get_value_int(i"Sef"OrgInfo[index][oSef]);
            
cache_get_value_int(i"Money"OrgInfo[index][oMoney]);
            
cache_get_value_int(i"Drugs"OrgInfo[index][oDrugs]);
            
cache_get_value_int(i"VW"OrgInfo[index][oVW]);
            
cache_get_value_int(i"Interior"OrgInfo[index][oInt]);
            
OrgInfo[i][orgExist] = true;
            
Iter_Add(i_Orgsindex);
            
OrgLabel(index);
        }
        
printf("Orgs loaded: %d"rows);
    }
    return 
1;




Re: Can you help? - Vince - 17.01.2017

The fact that you're never changing "index" after its first initialization, thereby overwriting the same slot over and over again.

Sidenote: member1 through member10 is not a proper way to store members. If a player can only be a member of one organization at a time then organizationID should be an attribute of player. Otherwise you need an association (see my sig).


Re: Can you help? - Micko123 - 17.01.2017

Quote:
Originally Posted by Vince
Посмотреть сообщение
The fact that you're never changing "index" after its first initialization, thereby overwriting the same slot over and over again.
How to do it?