Sames vehicles spawns two time.
#1

Hay,
I do not want bore you, but i have this problem: when the gamemode is initialized the vehicles are 16 but when i spawn
their will become 32, and spawn one above the other, why?! I have looking about this problem on ****** and i find one other discussion on sa-mp forum but it wasn't helping.
Reply
#2

We can't help you if we don't have a source to look at
Reply
#3

isn't a source issue but anyway i will show you..

pawn Код:
public OnGameModeInit()
{
        AddStaticVehicleEx(470,126.7000000,1937.3000000,19.4000000,0.0000000,95,10,15); //Patriot
    AddStaticVehicleEx(470,131.8999900,1937.4000000,19.4000000,0.0000000,95,10,15); //Patriot
    AddStaticVehicleEx(470,137.2000000,1937.4000000,19.4000000,0.0000000,95,10,15); //Patriot
    AddStaticVehicleEx(470,143.2002000,1937.4004000,19.4300000,0.0000000,95,10,15); //Patriot
    AddStaticVehicleEx(433,202.5000000,1917.5000000,18.2300000,0.0000000,95,10,15); //Barracks
    AddStaticVehicleEx(433,211.2998000,1917.5996000,18.2300000,0.0000000,95,10,15); //Barracks
    AddStaticVehicleEx(432,220.3999900,1916.2000000,17.7000000,0.0000000,95,10,15); //Rhino
    AddStaticVehicleEx(432,194.2000000,1916.8000000,17.7000000,0.0000000,95,10,15); //Rhino
    AddStaticVehicleEx(487,144.6000100,1834.9000000,21.9000000,90.0000000,165,169,15); //Maverick
    AddStaticVehicleEx(487,131.2998000,1903.0000000,23.0000000,0.0000000,165,169,15); //Maverick
    AddStaticVehicleEx(468,283.2000100,1824.8000000,17.4000000,64.0000000,157,152,15); //Sanchez
    AddStaticVehicleEx(468,283.2000100,1822.8000000,17.4000000,63.9950000,157,152,15); //Sanchez
    AddStaticVehicleEx(468,283.0000000,1820.8000000,17.4000000,63.9950000,157,152,15); //Sanchez
    AddStaticVehicleEx(468,283.2999900,1818.6000000,17.4000000,63.9900000,157,152,15); //Sanchez
    AddStaticVehicleEx(553,305.0000000,1812.9004000,19.9000000,1.5000000,145,115,15); //Nevada
    AddStaticVehicleEx(447,197.5000000,1835.7002000,23.3000000,0.0000000,32,32,15); //Seasparrow
    AddStaticVehicleEx(487,188.1000100,1835.4000200,23.5000000,0.0000000,151,149,15); //Maverick
    AddStaticVehicleEx(447,178.3000000,1835.9000000,23.3000000,0.0000000,32,32,15); //Seasparrow
    AddStaticVehicleEx(447,239.7000000,1835.7000000,23.3000000,0.0000000,32,32,15); //Seasparrow
    AddStaticVehicleEx(487,188.0996100,1835.4004000,23.5000000,0.0000000,151,149,15); //Maverick
    AddStaticVehicleEx(487,230.6000100,1836.3000000,23.5000000,0.0000000,151,149,15); //Maverick
    AddStaticVehicleEx(447,221.6000100,1835.8000000,23.3000000,0.0000000,32,32,15); //Seasparrow
    AddStaticVehicleEx(563,333.5000000,1918.4000000,18.5000000,62.0000000,99,132,15); //Raindance
    AddStaticVehicleEx(548,336.1000100,1935.2000000,19.5000000,90.0000000,245,245,15); //Cargobob
    AddStaticVehicleEx(417,335.5000000,1952.4000000,16.6000000,110.0000000,-1,-1,15); //Leviathan
    AddStaticVehicleEx(432,277.1000100,1947.3000000,17.7000000,300.0000000,95,10,15); //Rhino
    AddStaticVehicleEx(432,276.6000100,1964.8000000,17.7000000,243.9980000,95,10,15); //Rhino
    AddStaticVehicleEx(432,274.2000100,1956.0000000,17.7000000,271.9980000,95,10,15); //Rhino
    AddStaticVehicleEx(490,300.2000100,2050.2000000,18.0000000,214.5000000,-1,-1,15); //FBI Rancher
    AddStaticVehicleEx(476,274.5000000,1982.7000000,18.8000000,320.0000000,215,142,15); //Rustler
    AddStaticVehicleEx(476,273.7000100,1998.0000000,18.8000000,229.9990000,215,142,15); //Rustler
    AddStaticVehicleEx(476,281.7999900,1990.4000000,18.8000000,271.9990000,215,142,15); //Rustler
    AddStaticVehicleEx(528,306.2000100,2050.3000000,17.8000000,214.0000000,-1,-1,15); //FBI Truck
    AddStaticVehicleEx(599,311.7999900,2051.0000000,18.0000000,214.0000000,-1,-1,15); //Police Ranger
    AddStaticVehicleEx(601,317.6000100,2050.3999000,17.6000000,214.0000000,245,245,15); //S.W.A.T. Van
    AddStaticVehicleEx(520,337.2000100,1976.8000000,21.4000000,90.0000000,-1,-1,15); //Hydra
    AddStaticVehicleEx(520,281.6000100,2023.5000000,21.4000000,0.0000000,-1,-1,15); //Hydra
    AddStaticVehicleEx(470,198.7000000,1899.2000000,17.8000000,342.0000000,95,10,15); //Patriot
    AddStaticVehicleEx(470,204.5000000,1898.9000000,17.8000000,16.0000000,95,10,15); //Patriot
    AddStaticVehicleEx(470,228.8999900,1898.6000000,17.8000000,18.0000000,95,10,15); //Patriot
    AddStaticVehicleEx(470,223.3999900,1898.4000000,17.8000000,344.0000000,95,10,15); //Patriot
    AddStaticVehicleEx(433,225.8999900,1888.5000000,18.2000000,0.0000000,95,10,15); //Barracks
    AddStaticVehicleEx(433,202.0000000,1888.2002000,18.2000000,0.0000000,95,10,15); //Barracks
    AddStaticVehicleEx(468,197.8999900,1877.9000000,17.4000000,17.9900000,157,152,15); //Sanchez
    AddStaticVehicleEx(468,200.3999900,1878.0000000,17.4000000,17.9850000,157,152,15); //Sanchez
    AddStaticVehicleEx(468,202.8999900,1878.6000000,17.4000000,17.9850000,157,152,15); //Sanchez
    AddStaticVehicleEx(468,205.6000100,1878.7000000,17.4000000,17.9850000,157,152,15); //Sanchez
    AddStaticVehicleEx(468,220.1000100,1879.4000000,17.4000000,17.9850000,157,152,15); //Sanchez
    AddStaticVehicleEx(468,223.6000100,1879.6000000,17.4000000,17.9850000,157,152,15); //Sanchez
    AddStaticVehicleEx(468,226.8000000,1879.8000000,17.4000000,17.9850000,157,152,15); //Sanchez
    AddStaticVehicleEx(468,229.5000000,1879.9000000,17.4000000,17.9850000,157,152,15); //Sanchez
        return 1;
}
Reply
#4

removed
Reply
#5

It can to be solved, i have solved it with a little fix:
pawn Код:
new fixDoubleVehicles;

public OnGameModeInit()
{
    fixDoubleVehicles = 0;

}

public OnPlayerConnect(playerid)
{
    fixDoubleVehicles++;
    if(fixDoubleVehicles == 1){SpawnVehicles();}else{fixDoubleVehicles--;}
}

forward SpawnVehicles();
public SpawnVehicles {
//all yours addstaticvehicles functions with all parameters
}
but i don't know why i must to do this inside of just declaring addstaticvehicles functions ongamemodeinit..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)