SA-MP Forums Archive
[FilterScript] Gang System V1 - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Gang System V1 (/showthread.php?tid=509876)

Pages: 1 2


Re: Gang System V1 - Konstantinos - 27.05.2014

Well any version between R8 r14 to R38 (latest) will work.

---

pawn Код:
forward loadGangs();
public loadGangs()
{
        for(new i; i != MAX_GANG; i++)
        {
                cache_get_field_content(0,"g_name",gInfo[i][g_name],dbHandle);
                cache_get_field_content(0,"g_motd",gInfo[i][g_motd],dbHandle);
                cache_get_field_content(0,"g_leader",gInfo[i][g_leader],dbHandle);
                gInfo[i][g_pos_hq][0] = cache_get_field_content_float(0,"g_hq_x",dbHandle);
                gInfo[i][g_pos_hq][1] = cache_get_field_content_float(0,"g_hq_y",dbHandle);
                gInfo[i][g_pos_hq][2] = cache_get_field_content_float(0,"g_hq_z",dbHandle);
                gInfo[i][g_pos_hq_int][0] = cache_get_field_content_float(0,"g_hq_int_x",dbHandle);
                gInfo[i][g_pos_hq_int][1] = cache_get_field_content_float(0,"g_hq_int_y",dbHandle);
                gInfo[i][g_pos_hq_int][2] = cache_get_field_content_float(0,"g_hq_int_z",dbHandle);
        }
        SetTimer("loadAllGangs",2000,false);
        return 1;
}
That's bad. Except that it will try to get data from invalid rows, it will set the timer that will create pickups and 3D labels even if there are no rows. Plus it will create those even if these gangs don't exist and by not resetting the variables, it will mess the things up.