addstaticvehicle command somehow spawns 2 cars instead of 1..
#1

im taking a shot at developing my own gm and ive got the car spawns for lv "sorted", it was causing a hell of alot of lag so what i did is only put 1 "addstaticvehicle" in. After i spawned, i noticed that there were 2 vehicles instead of 1..

Below is the code i have
Quote:

AddStaticVehicle(411,2039.8345,1321.7892,10.6719);//spawn infernus

Can someone please let me know how i can fix this?
Reply
#2

Have any FS's that are related to Car spawning/streaming ? If yes, then search there - Just hit CTRL+F and type the Vehicles ID.
If not, then delete it, go in game and see what happens. If it's ok, put back in again.
Reply
#3

ok i made sure i had no other vehicle scripts... i tried "CreateVehicle" yet for some reason.. there were maybe 50 or more spawning at once place.. kind of looked like a fountain...

i was a bit late at getting the screenshot but take a look at the radar...
Anyway, why would this happen? and what can i do to fix it.
Reply
#4

Does your gamemodeint Return anything?
Reply
#5

yeah it has return 1;
Reply
#6

Post your whole OnGameModeInit line.
Btw, ROFL, that SS is fucking awesome!
Reply
#7

Thats what i got.
Quote:

public OnGameModeInit()
{

SetGameModeText("DM*FR*STUNT*TUNE");
for(new i = 0; i < 299; i++)
{
if(IsValidSkin(i))
{
AddPlayerClass(i,2024.6547,1342.9247,10.8203,270.3 763,0,0,0,0,0,0);
ShowNameTags(1);
ShowPlayerMarkers(1);
SetWorldTime(12);
UsePlayerPedAnims();

//Pickups
AddStaticPickup(1240,2,1124.7144,-2025.2495,69.007;// health admin area
AddStaticPickup(1242,2,1125.1913,-2017.7397,69.007;//armour admin area
AddStaticPickup(350,2,1124.8156,-2010.0177,69.007;// admin area
AddStaticPickup(370,15,1209.1556,-1999.2952,69.007;// admin area
AddStaticPickup(1242,2,2362.7263,-1120.1473,1050.8826);// armour old admin arena
AddStaticPickup(1242,2,2743.199,-2453.34,13.86226); //armour army
AddStaticPickup(358,2,2491.052,-1579.474,23.24112); //sniper outside ganton
AddStaticPickup(350,2,2077.1440,-2087.8467,16.0759); // sawnoff
AddStaticPickup(359,2,2659.9661,-1444.5132,16.2500); //rocketlancher
AddStaticPickup(352,2,2330.4641,-1700.3735,13.5437); // uzi
AddStaticPickup(348,2,508.1598,-84.6235,998.9609);// deagle ten green bottles bar
AddStaticPickup(356,2,2065.9180,-1585.4769,13.4842);
AddStaticPickup(356,2,1679.1064,-1964.0129,21.9609);
AddStaticPickup(348,2,2765.1885,-2182.5457,11.088;
AddStaticPickup(351,2,2835.7402,-2390.6587,14.6081);
AddStaticPickup(352,2,2690.6270,-1331.5509,44.2716);
AddStaticPickup(350,2,2751.6565,-1181.8479,69.4006);
AddStaticPickup(357,2,2560.1357,-913.4852,83.7750);
AddStaticPickup(1242,2,2560.5601,-1133.0898,63.7093);
AddStaticPickup(353,2,2543.4729,-1120.7712,61.9031);
AddStaticPickup(365,2,2501.5056,-1073.0641,70.132;
AddStaticPickup(355,2,2208.2939,-1186.8585,33.5313);
AddStaticPickup(1242,2,2208.4814,-1101.2257,31.5547);
AddStaticPickup(337,2,2455.0811,-1708.0450,13.6179);
AddStaticPickup(355,2,2468.4485,-1772.1685,13.5581);
AddStaticPickup(1242,3,1805.9583,-1590.4363,14.0469);
AddStaticPickup(355,3,1853.5994,-1587.0889,29.0469);
AddStaticPickup(357,3,1908.8861,-1583.2286,29.0500);
AddStaticPickup(1242,3,1057.9862,-1692.7179,14.3672);
AddStaticPickup(1242,3,969.4689,-1634.9146,13.5377);
AddStaticPickup(355,3,983.0530,-1641.6554,13.5234);
AddStaticPickup(356,3,1173.0560,-2036.3949,69.1413);

AddStaticPickup(360,3,1177.4680,-2079.1792,69.007;
AddStaticPickup(358,3,1141.6779,-2077.2529,69.007;
AddStaticPickup(348,3,1125.5182,-2055.9568,69.007;
AddStaticPickup(352,3,1126.0757,-2062.0164,69.007;

AddStaticPickup(1242,3,2688.4221,-2114.6604,13.548;
AddStaticPickup(355,3,2809.0820,-1113.0950,30.718;
AddStaticPickup(1242,3,2821.4761,-1214.6162,25.8815);
AddStaticPickup(357,3,2815.0115,-1230.3339,42.6525);
AddStaticPickup(356,3,2327.1057,-1248.8105,22.5000);
AddStaticPickup(1242,3,2345.9807,-1247.1226,22.5000);
AddStaticPickup(353,3,1973.9126,-1223.6384,20.0234);
AddStaticPickup(1242,3,810.0639,-1161.3955,16.9766);
AddStaticPickup(357,3,916.2736,-1271.3247,19.0859);
AddStaticPickup(1240,3,1031.2074,-1360.5779,13.5743);
AddStaticPickup(361,3,1078.4050,-1425.3088,13.5684);
AddStaticPickup(1242,3,1783.1991,-1427.9604,16.9682);
AddStaticPickup(355,3,1794.0187,-1420.2145,16.9609);
AddStaticPickup(353,3,1809.8407,-1384.8335,14.9219);

AddStaticPickup(1242,3,726.0289,-1276.3831,13.6484);
AddStaticPickup(1242,3,2684.4497,-1539.2809,26.4236);
AddStaticPickup(1242,3,2522.4668,-1701.8077,16.5944);// grove armour
AddStaticPickup(1240,3,2477.0767,-1903.8900,17.5500); // health on roof
AddStaticPickup(370, 15, -2209.4707,294.1174,35.1172); // jetpack
AddStaticPickup(370, 15, -1765.4392,-174.7473,3.5547); // jetpack
AddStaticPickup(1240,3,2232.699,-1179.409,29.20439);//BallasHealthPickup
AddStaticPickup(372,3,2494.4333,-1700.5466,22.640; // guns2
AddStaticPickup(1240,3,1206.5338,-1727.9563,13.5702); // nang gunz
AddStaticPickup(372,3,1198.9290,-1734.1022,13.573; // nang gunz3
AddStaticPickup(1240,3,1828.9779,-1694.2731,13.5469); // aztecs
AddStaticPickup(372,3,1828.8510,-1672.0320,13.5469); // aztecs3
AddStaticPickup(372,3,2831.8074,-1182.6426,24.8195); // vagos guns1
AddStaticPickup(1240,3,2813.351,-1233.175,44.59693); // vagos health
AddStaticPickup(1242,3,2147.8552,-2269.2341,14.2344); // armour mafia
AddStaticPickup(372,3,2147.2861,-2265.1370,14.4545); // more guns
AddStaticPickup(1242,3, 261.50, 71.22, 1003.24); //cops armour

//vehiclespawns
AddStaticVehicle(505,2039.0239,1372.6218,10.8151,1 83.2154,112,120); //
}
}
return 1;
}
Reply
#8

My guess is that it is the loop that you have in there. Maybe it is formated incorrectly causing the vehicle to spawn 299 times?

I am on psp so the format/code is hard to understand. :S

btw: max players on a samp server is 200.
Reply
#9

ok well i dont know what happened but i took out the code inside my script for the vehicles and used taxi's vehicle streamer and now it works without any problems.
Reply
#10

on PC now

btw I was right :P, you close the loop after making all the pick-ups and the vehicle. It Should Be Like This;

pawn Код:
public OnGameModeInit()
{

  SetGameModeText("DM*FR*STUNT*TUNE");
  for(new i = 0; i < 299; i++)
  {
    if(IsValidSkin(i))
    {
      AddPlayerClass(i,2024.6547,1342.9247,10.8203,270.3763,0,0,0,0,0,0);
      ShowNameTags(1);
      ShowPlayerMarkers(1);
        SetWorldTime(12);
        UsePlayerPedAnims();
    }//you had this bracket
   }//and this one at the bottom

  //Pickups
  AddStaticPickup(1240,2,1124.7144,-2025.2495,69.0078);// health admin area
  AddStaticPickup(1242,2,1125.1913,-2017.7397,69.0078);//armour admin area
  AddStaticPickup(350,2,1124.8156,-2010.0177,69.0078);// admin area
  AddStaticPickup(370,15,1209.1556,-1999.2952,69.0078);// admin area
  AddStaticPickup(1242,2,2362.7263,-1120.1473,1050.8826);// armour old admin arena
  AddStaticPickup(1242,2,2743.199,-2453.34,13.86226); //armour army
  AddStaticPickup(358,2,2491.052,-1579.474,23.24112); //sniper outside ganton
  AddStaticPickup(350,2,2077.1440,-2087.8467,16.0759); // sawnoff
  AddStaticPickup(359,2,2659.9661,-1444.5132,16.2500); //rocketlancher
  AddStaticPickup(352,2,2330.4641,-1700.3735,13.5437); // uzi
  AddStaticPickup(348,2,508.1598,-84.6235,998.9609);// deagle ten green bottles bar
  AddStaticPickup(356,2,2065.9180,-1585.4769,13.4842);
  AddStaticPickup(356,2,1679.1064,-1964.0129,21.9609);
  AddStaticPickup(348,2,2765.1885,-2182.5457,11.0888);
  AddStaticPickup(351,2,2835.7402,-2390.6587,14.6081);
  AddStaticPickup(352,2,2690.6270,-1331.5509,44.2716);
  AddStaticPickup(350,2,2751.6565,-1181.8479,69.4006);
  AddStaticPickup(357,2,2560.1357,-913.4852,83.7750);
  AddStaticPickup(1242,2,2560.5601,-1133.0898,63.7093);
  AddStaticPickup(353,2,2543.4729,-1120.7712,61.9031);
  AddStaticPickup(365,2,2501.5056,-1073.0641,70.1328);
  AddStaticPickup(355,2,2208.2939,-1186.8585,33.5313);
  AddStaticPickup(1242,2,2208.4814,-1101.2257,31.5547);
  AddStaticPickup(337,2,2455.0811,-1708.0450,13.6179);
  AddStaticPickup(355,2,2468.4485,-1772.1685,13.5581);
  AddStaticPickup(1242,3,1805.9583,-1590.4363,14.0469);
  AddStaticPickup(355,3,1853.5994,-1587.0889,29.0469);
  AddStaticPickup(357,3,1908.8861,-1583.2286,29.0500);
  AddStaticPickup(1242,3,1057.9862,-1692.7179,14.3672);
  AddStaticPickup(1242,3,969.4689,-1634.9146,13.5377);
  AddStaticPickup(355,3,983.0530,-1641.6554,13.5234);
  AddStaticPickup(356,3,1173.0560,-2036.3949,69.1413);

  AddStaticPickup(360,3,1177.4680,-2079.1792,69.0078);
  AddStaticPickup(358,3,1141.6779,-2077.2529,69.0078);
  AddStaticPickup(348,3,1125.5182,-2055.9568,69.0078);
  AddStaticPickup(352,3,1126.0757,-2062.0164,69.0078);

  AddStaticPickup(1242,3,2688.4221,-2114.6604,13.5488);
  AddStaticPickup(355,3,2809.0820,-1113.0950,30.7188);
  AddStaticPickup(1242,3,2821.4761,-1214.6162,25.8815);
  AddStaticPickup(357,3,2815.0115,-1230.3339,42.6525);
  AddStaticPickup(356,3,2327.1057,-1248.8105,22.5000);
  AddStaticPickup(1242,3,2345.9807,-1247.1226,22.5000);
  AddStaticPickup(353,3,1973.9126,-1223.6384,20.0234);
  AddStaticPickup(1242,3,810.0639,-1161.3955,16.9766);
  AddStaticPickup(357,3,916.2736,-1271.3247,19.0859);
  AddStaticPickup(1240,3,1031.2074,-1360.5779,13.5743);
  AddStaticPickup(361,3,1078.4050,-1425.3088,13.5684);
  AddStaticPickup(1242,3,1783.1991,-1427.9604,16.9682);
  AddStaticPickup(355,3,1794.0187,-1420.2145,16.9609);
  AddStaticPickup(353,3,1809.8407,-1384.8335,14.9219);

    AddStaticPickup(1242,3,726.0289,-1276.3831,13.6484);
    AddStaticPickup(1242,3,2684.4497,-1539.2809,26.4236);
    AddStaticPickup(1242,3,2522.4668,-1701.8077,16.5944);// grove armour
    AddStaticPickup(1240,3,2477.0767,-1903.8900,17.5500); // health on roof
    AddStaticPickup(370, 15, -2209.4707,294.1174,35.1172); // jetpack
    AddStaticPickup(370, 15, -1765.4392,-174.7473,3.5547); // jetpack
    AddStaticPickup(1240,3,2232.699,-1179.409,29.20439);//BallasHealthPickup
    AddStaticPickup(372,3,2494.4333,-1700.5466,22.6408); // guns2
    AddStaticPickup(1240,3,1206.5338,-1727.9563,13.5702); // nang gunz
    AddStaticPickup(372,3,1198.9290,-1734.1022,13.5738); // nang gunz3
    AddStaticPickup(1240,3,1828.9779,-1694.2731,13.5469); // aztecs
    AddStaticPickup(372,3,1828.8510,-1672.0320,13.5469); // aztecs3
    AddStaticPickup(372,3,2831.8074,-1182.6426,24.8195); // vagos guns1
    AddStaticPickup(1240,3,2813.351,-1233.175,44.59693); // vagos health
    AddStaticPickup(1242,3,2147.8552,-2269.2341,14.2344); // armour mafia
    AddStaticPickup(372,3,2147.2861,-2265.1370,14.4545); // more guns
    AddStaticPickup(1242,3, 261.50, 71.22, 1003.24); //cops armour

    //vehiclespawns
  AddStaticVehicle(505,2039.0239,1372.6218,10.8151,183.2154,112,120); //
  return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)