GM duplicate objects
#1

Hello!

When i adding objects and vehicles, they geting duplicated of some reason.
What can that depend on?

My OnGameModeInit:
pawn Code:
public OnGameModeInit()
{
    for(new i = 0; i <= sizeof(Skins)-1; i++)
    {
        AddPlayerClass(Skins[i][0],415.0729,2535.5854,19.1484,359.2198,-1,-1,-1,-1,-1,-1);
        ShowPlayerMarkers(1);
        AllowAdminTeleport(1);
        SetWeather(14);
        SetWorldTime(12);
        EnableStuntBonusForAll(0);

        AddStaticVehicleEx(476,419.9781,2441.7148,17.2157,90.9542,3,3,600); // New player
        AddStaticVehicleEx(476,419.7993,2453.4229,17.2155,89.1848,3,3,600); // New player
        AddStaticVehicleEx(476,420.0335,2466.9705,17.2098,88.6598,3,3,600); // New player
        AddStaticVehicleEx(476,389.5863,2439.7012,17.2138,273.9613,3,3,600); // New player
        AddStaticVehicleEx(476,389.2481,2452.0327,17.2109,271.2024,3,3,600); // New player
        AddStaticVehicleEx(476,389.3371,2466.8743,17.2080,269.3279,3,3,600); // New player
        AddStaticVehicleEx(476,369.9770,2471.4199,17.1923,1.0170,3,3,600); // New player
        AddStaticVehicleEx(476,355.2772,2471.4446,17.1924,0.1990,3,3,600); // New player
        AddStaticVehicleEx(476,341.0659,2471.6011,17.1892,359.4792,3,3,600); // New player
        AddStaticVehicleEx(476,289.9539,2536.9458,17.5328,182.0488,3,3,600); // New player
        AddStaticVehicleEx(476,324.9881,2537.0947,17.5249,180.0883,3,3,600); // New player
        AddStaticVehicleEx(476,342.7910,2537.0664,17.4873,180.8570,3,3,600); // New player
        AddStaticVehicleEx(476,382.3123,2537.2183,17.2524,180.4406,3,3,600); // New player
        AddStaticVehicleEx(548,364.2266,2536.7107,16.7929,175.6206,3,3,600); // New player Cargobob
        AddStaticVehicleEx(432,330.9751,2547.3921,16.8178,1.1064,0,0,600); // New Player Rhino
        AddStaticVehicleEx(432,320.8236,2548.0957,16.8227,359.7192,0,0,600); // New Player Rhino
        AddStaticVehicleEx(432,296.3745,2548.3577,16.8338,358.0152,0,0,600); // New Player Rhino
        AddStaticVehicleEx(432,284.9641,2548.6011,16.8317,359.1052,0,0,600); //New Player Rhino
        AddStaticVehicleEx(425,311.9832,2466.6350,17.0458,1.7575,0,0,600); // hunter newplayer
        AddStaticVehicleEx(425,296.9786,2468.4695,17.0488,5.5592,0,0,600); // hunter newplayer
        AddStaticVehicleEx(425,283.6572,2467.3645,17.0476,6.3777,0,0,600); // hunter newplayer
    }
    return 1;
}
Reply
#2

what do you mean sir?
Reply
#3

Quote:
Originally Posted by cacauagiar
View Post
what do you mean sir?
I mean that one single object or vehicle duplicates, if i add 1 car in the game mode scrip...there is 2 cars at exactly the same coords, if i add 10 cars..there is 20 cars etc.
Reply
#4

Ohh I got that once but I replaced my AddStaticVehicleEx to CreateVehicle, maybe it helps you.
can you help me here? https://sampforum.blast.hk/showthread.php?tid=289573
Reply
#5

Quote:
Originally Posted by cacauagiar
View Post
Ohh I got that once but I replaced my AddStaticVehicleEx to CreateVehicle, maybe it helps you.
can you help me here? https://sampforum.blast.hk/showthread.php?tid=289573
No that didn't help.
How can i help you in my own thread?
Reply
#6

Does anyone know what can cause this duplication?
It's annoying that i can not add vehicles and objects just because they duplicate themselves :/
Reply
#7

It might be, because its inside the loop.
pawn Code:
public OnGameModeInit()
{
    for(new i = 0; i <= sizeof(Skins)-1; i++)
    {
        AddPlayerClass(Skins[i][0],415.0729,2535.5854,19.1484,359.2198,-1,-1,-1,-1,-1,-1);
    }
    ShowPlayerMarkers(1);
    AllowAdminTeleport(1);
    SetWeather(14);
    SetWorldTime(12);
    EnableStuntBonusForAll(0);

    AddStaticVehicleEx(476,419.9781,2441.7148,17.2157,90.9542,3,3,600); // New player
    AddStaticVehicleEx(476,419.7993,2453.4229,17.2155,89.1848,3,3,600); // New player
    AddStaticVehicleEx(476,420.0335,2466.9705,17.2098,88.6598,3,3,600); // New player
    AddStaticVehicleEx(476,389.5863,2439.7012,17.2138,273.9613,3,3,600); // New player
    AddStaticVehicleEx(476,389.2481,2452.0327,17.2109,271.2024,3,3,600); // New player
    AddStaticVehicleEx(476,389.3371,2466.8743,17.2080,269.3279,3,3,600); // New player
    AddStaticVehicleEx(476,369.9770,2471.4199,17.1923,1.0170,3,3,600); // New player
    AddStaticVehicleEx(476,355.2772,2471.4446,17.1924,0.1990,3,3,600); // New player
    AddStaticVehicleEx(476,341.0659,2471.6011,17.1892,359.4792,3,3,600); // New player
    AddStaticVehicleEx(476,289.9539,2536.9458,17.5328,182.0488,3,3,600); // New player
    AddStaticVehicleEx(476,324.9881,2537.0947,17.5249,180.0883,3,3,600); // New player
    AddStaticVehicleEx(476,342.7910,2537.0664,17.4873,180.8570,3,3,600); // New player
    AddStaticVehicleEx(476,382.3123,2537.2183,17.2524,180.4406,3,3,600); // New player
    AddStaticVehicleEx(548,364.2266,2536.7107,16.7929,175.6206,3,3,600); // New player Cargobob
    AddStaticVehicleEx(432,330.9751,2547.3921,16.8178,1.1064,0,0,600); // New Player Rhino
    AddStaticVehicleEx(432,320.8236,2548.0957,16.8227,359.7192,0,0,600); // New Player Rhino
    AddStaticVehicleEx(432,296.3745,2548.3577,16.8338,358.0152,0,0,600); // New Player Rhino
    AddStaticVehicleEx(432,284.9641,2548.6011,16.8317,359.1052,0,0,600); //New Player Rhino
    AddStaticVehicleEx(425,311.9832,2466.6350,17.0458,1.7575,0,0,600); // hunter newplayer
    AddStaticVehicleEx(425,296.9786,2468.4695,17.0488,5.5592,0,0,600); // hunter newplayer
    AddStaticVehicleEx(425,283.6572,2467.3645,17.0476,6.3777,0,0,600); // hunter newplayer
    return 1;
}
Try it like that, so its outside the loop. If its not fixed like that, i dont really know what the problem could be.
Reply
#8

Quote:
Originally Posted by Wesley221
View Post
It might be, because its inside the loop.
pawn Code:
public OnGameModeInit()
{
    for(new i = 0; i <= sizeof(Skins)-1; i++)
    {
        AddPlayerClass(Skins[i][0],415.0729,2535.5854,19.1484,359.2198,-1,-1,-1,-1,-1,-1);
    }
    ShowPlayerMarkers(1);
    AllowAdminTeleport(1);
    SetWeather(14);
    SetWorldTime(12);
    EnableStuntBonusForAll(0);

    AddStaticVehicleEx(476,419.9781,2441.7148,17.2157,90.9542,3,3,600); // New player
    AddStaticVehicleEx(476,419.7993,2453.4229,17.2155,89.1848,3,3,600); // New player
    AddStaticVehicleEx(476,420.0335,2466.9705,17.2098,88.6598,3,3,600); // New player
    AddStaticVehicleEx(476,389.5863,2439.7012,17.2138,273.9613,3,3,600); // New player
    AddStaticVehicleEx(476,389.2481,2452.0327,17.2109,271.2024,3,3,600); // New player
    AddStaticVehicleEx(476,389.3371,2466.8743,17.2080,269.3279,3,3,600); // New player
    AddStaticVehicleEx(476,369.9770,2471.4199,17.1923,1.0170,3,3,600); // New player
    AddStaticVehicleEx(476,355.2772,2471.4446,17.1924,0.1990,3,3,600); // New player
    AddStaticVehicleEx(476,341.0659,2471.6011,17.1892,359.4792,3,3,600); // New player
    AddStaticVehicleEx(476,289.9539,2536.9458,17.5328,182.0488,3,3,600); // New player
    AddStaticVehicleEx(476,324.9881,2537.0947,17.5249,180.0883,3,3,600); // New player
    AddStaticVehicleEx(476,342.7910,2537.0664,17.4873,180.8570,3,3,600); // New player
    AddStaticVehicleEx(476,382.3123,2537.2183,17.2524,180.4406,3,3,600); // New player
    AddStaticVehicleEx(548,364.2266,2536.7107,16.7929,175.6206,3,3,600); // New player Cargobob
    AddStaticVehicleEx(432,330.9751,2547.3921,16.8178,1.1064,0,0,600); // New Player Rhino
    AddStaticVehicleEx(432,320.8236,2548.0957,16.8227,359.7192,0,0,600); // New Player Rhino
    AddStaticVehicleEx(432,296.3745,2548.3577,16.8338,358.0152,0,0,600); // New Player Rhino
    AddStaticVehicleEx(432,284.9641,2548.6011,16.8317,359.1052,0,0,600); //New Player Rhino
    AddStaticVehicleEx(425,311.9832,2466.6350,17.0458,1.7575,0,0,600); // hunter newplayer
    AddStaticVehicleEx(425,296.9786,2468.4695,17.0488,5.5592,0,0,600); // hunter newplayer
    AddStaticVehicleEx(425,283.6572,2467.3645,17.0476,6.3777,0,0,600); // hunter newplayer
    return 1;
}
Try it like that, so its outside the loop. If its not fixed like that, i dont really know what the problem could be.
Ah thanks! that was a pretty stupid mistake of me..one star for you!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)