SA-MP Forums Archive
ID problem - 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: ID problem (/showthread.php?tid=515250)



ID problem - PakPak - 25.05.2014

Hello,

I've a problem with my ID, when I load my factions:

pawn Код:
public OnFactionLoad() {
    nbFaction = cache_num_rows();
    for(new i = 0; i < nbFaction; i++) {
        new ORM:ormid = FactionInfo[i][ORM_ID] = orm_create("factions");
        orm_addvar_int(ormid, FactionInfo[i][fID], "ID");
        orm_setkey(ormid, "ID");
        orm_addvar_int(ormid, FactionInfo[i][fType], "type");
        orm_addvar_int(ormid, FactionInfo[i][fCash], "cash");
        orm_addvar_string(ormid, FactionInfo[i][fName],64, "name");
        orm_addvar_string(ormid, FactionInfo[i][fRank1],64, "rank1");
        orm_addvar_string(ormid, FactionInfo[i][fRank2],64, "rank2");
        orm_addvar_string(ormid, FactionInfo[i][fRank3],64, "rank3");
        orm_addvar_string(ormid, FactionInfo[i][fRank4],64, "rank4");
        orm_addvar_string(ormid, FactionInfo[i][fRank5],64, "rank5");
        orm_addvar_string(ormid, FactionInfo[i][fRank6],64, "rank6");
        orm_addvar_string(ormid, FactionInfo[i][fRank7],64, "rank7");
        orm_addvar_string(ormid, FactionInfo[i][fRank8],64, "rank8");
        orm_apply_cache(ormid, i);
    }
}
Faction ID 1 in my database, become ID 0 in game.

I've already tried to start my for statement a 1 but it doesn't work.

Thanks


Re: ID problem - superrobot48 - 25.05.2014

try changing
pawn Код:
for(new i = 0; i < nbFaction; i++) {
to
pawn Код:
for(new i = 1; i < nbFaction; i++) {



Re : ID problem - PakPak - 25.05.2014

It doesn't work, It only load 4 factions instead of 5 if I change nbFaction, it's still the same


Re: ID problem - BroZeus - 25.05.2014

pawn Код:
for(new i = 1; i < nbFaction+1; i++)
try this


Re : Re: ID problem - PakPak - 25.05.2014

Quote:
Originally Posted by BroZeus
Посмотреть сообщение
pawn Код:
for(new i = 1; i < nbFaction+1; i++)
try this
It load an empty faction, then the faction ID 2 in the database.