SA-MP Forums Archive
Dynamic Pickups not spawning - 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: Dynamic Pickups not spawning (/showthread.php?tid=603720)



Dynamic Pickups not spawning - theonethatownz - 26.03.2016

I create them IG with a command. They show up and save to MySQL. When I load the gamemode, I use this to load them:

pawn Код:
forward LoadEntrances();
public LoadEntrances()
{
    if(cache_num_rows())
    {
        for(new i = 0; i<cache_num_rows(); i++)
        {
           
            new eid = cache_get_field_content_int(i, "ID", mysql);
            Entrance[eid][ID] = eid;
            Entrance[eid][posX] = cache_get_field_content_float(i, "PosX", mysql);
            Entrance[eid][posY] = cache_get_field_content_float(i, "PosY", mysql);
            Entrance[eid][posZ] = cache_get_field_content_float(i, "PosZ", mysql);
            Entrance[eid][posX] = cache_get_field_content_float(i, "iPosX", mysql);
            Entrance[eid][posY] = cache_get_field_content_float(i, "iPosY", mysql);
            Entrance[eid][posZ] = cache_get_field_content_float(i, "iPosZ", mysql);
            Entrance[eid][VW] = cache_get_field_content_int(i, "VW", mysql);
            Entrance[eid][Interior] = cache_get_field_content_int(i, "Interior", mysql);
            Entrance[eid][ID] = CreateDynamicPickup(1318, 1, Entrance[eid][posX], Entrance[eid][posY], Entrance[eid][posZ]);
            Total_Entrances_Created ++;
            printf("[MYSQL] Loading Entrance %d", Entrance[eid][ID]);
        }
    }
    printf("[MYSQL]: %d Entrances have been successfully loaded from the database.", Total_Entrances_Created);
    return 1;
}
It's printing that they have been loaded successfully.


Re: Dynamic Pickups not spawning - czerwony03 - 26.03.2016

PHP код:
            Entrance[eid][posX] = cache_get_field_content_float(i"PosX"mysql);
            
Entrance[eid][posY] = cache_get_field_content_float(i"PosY"mysql);
            
Entrance[eid][posZ] = cache_get_field_content_float(i"PosZ"mysql);
            
Entrance[eid][posX] = cache_get_field_content_float(i"iPosX"mysql);
            
Entrance[eid][posY] = cache_get_field_content_float(i"iPosY"mysql);
            
Entrance[eid][posZ] = cache_get_field_content_float(i"iPosZ"mysql); 
Silly bug.
You are saving iPosX, iPosY and iPosZ to posX, posY, posZ variables.


Re: Dynamic Pickups not spawning - theonethatownz - 27.03.2016

Oh yea, stupid me.