[VIDEO] Vehicles Respawn bug
#1

https://www.youtube.com/watch?v=MmKHg58cJUA , please watch the video you will se the bug
here is the code
Код:
//BF VEHICLES NEW
tank[0] = AddStaticVehicleEx(432,624.9035000,908.9672000,-43.9785000,0.0000000,-1,-1,70); //Rhino
tank[1] = AddStaticVehicleEx(432,648.4333000,881.5867000,-42.6456000,0.0000000,-1,-1,70); //Rhino
tank[2] = AddStaticVehicleEx(432,521.7079000,936.7822000,-25.7328000,0.0000000,-1,-1,70); //Rhino
tank[3] = AddStaticVehicleEx(432,524.4857000,905.1155000,-41.4546000,0.0000000,-1,-1,70); //Rhino
tank[4] = AddStaticVehicleEx(432,524.7346000,828.6412000,-26.9675000,0.0000000,-1,-1,70); //Rhino
tank[5] = AddStaticVehicleEx(432,625.6069000,819.2535000,-43.5309000,0.0000000,-1,-1,70); //Rhino
tank[6] = AddStaticVehicleEx(432,617.8084000,819.5673000,-43.5309000,0.0000000,-1,-1,70); //Rhino
tank[7] = AddStaticVehicleEx(432,609.6564000,820.1940000,-43.5309000,0.0000000,-1,-1,70); //Rhino
tank[8] = AddStaticVehicleEx(432,595.7318000,848.0513000,-43.7661000,0.0000000,-1,-1,70); //Rhino
tank[9] = AddStaticVehicleEx(432,604.5948000,848.4281000,-43.7661000,0.0000000,-1,-1,70); //Rhino
SetVehicleVirtualWorld(tank[0], 50);SetVehicleVirtualWorld(tank[1], 50);
SetVehicleVirtualWorld(tank[2], 50);SetVehicleVirtualWorld(tank[3], 50);
SetVehicleVirtualWorld(tank[4], 50);SetVehicleVirtualWorld(tank[5], 50);
SetVehicleVirtualWorld(tank[6], 50);SetVehicleVirtualWorld(tank[7], 50);
SetVehicleVirtualWorld(tank[8], 50);SetVehicleVirtualWorld(tank[9], 50);

vehiclebf[0] = AddStaticVehicleEx(522,4786.4731000,518.2126000,13.9889000,0.0000000,-1,-1,70); //NRG-500
vehiclebf[1] = AddStaticVehicleEx(425,4910.7583000,570.9725000,13.7875000,0.0000000,-1,-1,70); //Hunter
vehiclebf[2] = AddStaticVehicleEx(425,4909.7959000,538.4467000,13.7875000,0.0000000,-1,-1,70); //Hunter
vehiclebf[3] = AddStaticVehicleEx(417,4714.4004000,476.2756000,16.2743000,0.0000000,-1,-1,70); //Leviathan
vehiclebf[4] = AddStaticVehicleEx(432,4749.0254000,541.5466000,13.0643000,0.0000000,-1,-1,70); //Rhino
vehiclebf[5] = AddStaticVehicleEx(432,4741.2148000,541.0989000,12.1482000,0.0000000,-1,-1,70); //Rhino
vehiclebf[6] = AddStaticVehicleEx(468,4837.0723000,482.4721000,4.9777000,0.0000000,-1,-1,70); //Sanchez
vehiclebf[7] = AddStaticVehicleEx(468,4843.3237000,481.9246000,4.9777000,0.0000000,-1,-1,70); //Sanchez
vehiclebf[8] = AddStaticVehicleEx(460,4889.7988000,507.6797000,1.8198000,-76.0000000,-1,-1,70); //Skimmer
vehiclebf[9] = AddStaticVehicleEx(460,4915.3936000,502.6610000,1.8198000,-76.0000000,-1,-1,70); //Skimmer
vehiclebf[10] = AddStaticVehicleEx(460,4911.0889000,483.1011000,1.8198000,-76.0000000,-1,-1,70); //Skimmer
vehiclebf[11] = AddStaticVehicleEx(471,4809.6348000,425.7699000,21.6399000,0.0000000,-1,-1,70); //Quad
vehiclebf[12] = AddStaticVehicleEx(471,4815.9292000,424.4350000,19.6153000,0.0000000,-1,-1,70); //Quad
vehiclebf[13] = AddStaticVehicleEx(471,4819.9316000,433.3899000,18.9425000,0.0000000,-1,-1,70); //Quad
vehiclebf[14] = AddStaticVehicleEx(468,4782.8384000,419.4306000,30.1008000,0.0000000,-1,-1,70); //Sanchez
vehiclebf[15] = AddStaticVehicleEx(484,4771.7822000,377.2853000,-0.1360000,-156.0000000,-1,-1,70); //Marquis
vehiclebf[16] = AddStaticVehicleEx(484,4764.2808000,373.4787000,-0.1360000,-156.0000000,-1,-1,70); //Marquis
vehiclebf[17] = AddStaticVehicleEx(453,4671.1514000,452.3989000,0.4460000,127.0000000,-1,-1,70); //Reefer
vehiclebf[18] = AddStaticVehicleEx(453,4664.9277000,463.8613000,0.4460000,127.0000000,-1,-1,70); //Reefer
vehiclebf[19] = AddStaticVehicleEx(432,4860.9307000,560.6983000,7.2004000,0.0000000,-1,-1,70); //Rhino
vehiclebf[20] = AddStaticVehicleEx(487,4840.1260000,551.1792000,7.0080000,0.0000000,-1,-1,70); //Maverick
vehiclebf[21] = AddStaticVehicleEx(502,4820.2095000,561.9141000,14.3318000,21.0000000,-1,-1,70); //Hotring Racer A
vehiclebf[22] = AddStaticVehicleEx(520,4810.6548000,567.0844000,15.3088000,15.7354000,-1,-1,70); //Hydra
vehiclebf[23] = AddStaticVehicleEx(520,4797.5630000,562.5554000,15.3088000,15.7354000,-1,-1,70); //Hydra
vehiclebf[24] = AddStaticVehicleEx(520,4782.7793000,557.5027000,15.7179000,15.7354000,-1,-1,70); //Hydra
vehiclebf[25] = AddStaticVehicleEx(548,4865.3711000,401.7659000,4.4446000,0.0000000,-1,-1,70); //Cargobob
vehiclebf[26] = AddStaticVehicleEx(520,4898.0342000,401.7626000,3.5516000,0.0000000,-1,-1,70); //Hydra
vehiclebf[27] = AddStaticVehicleEx(425,4900.2314000,372.3449000,3.5071000,0.0000000,-1,-1,70); //Hunter
    
SetVehicleVirtualWorld(vehiclebf[0], 50);SetVehicleVirtualWorld(vehiclebf[1], 50);
SetVehicleVirtualWorld(vehiclebf[2], 50);SetVehicleVirtualWorld(vehiclebf[3], 50);
SetVehicleVirtualWorld(vehiclebf[4], 50);SetVehicleVirtualWorld(vehiclebf[5], 50);
SetVehicleVirtualWorld(vehiclebf[6], 50);SetVehicleVirtualWorld(vehiclebf[7], 50);
SetVehicleVirtualWorld(vehiclebf[8], 50);SetVehicleVirtualWorld(vehiclebf[9], 50);
SetVehicleVirtualWorld(vehiclebf[10], 50);SetVehicleVirtualWorld(vehiclebf[11], 50);
SetVehicleVirtualWorld(vehiclebf[12], 50);SetVehicleVirtualWorld(vehiclebf[13], 50);
SetVehicleVirtualWorld(vehiclebf[14], 50);SetVehicleVirtualWorld(vehiclebf[15], 50);
SetVehicleVirtualWorld(vehiclebf[16], 50);SetVehicleVirtualWorld(vehiclebf[17], 50);
SetVehicleVirtualWorld(vehiclebf[18], 50);SetVehicleVirtualWorld(vehiclebf[19], 50);
SetVehicleVirtualWorld(vehiclebf[20], 50);SetVehicleVirtualWorld(vehiclebf[21], 50);
SetVehicleVirtualWorld(vehiclebf[22], 50);SetVehicleVirtualWorld(vehiclebf[23], 50);
SetVehicleVirtualWorld(vehiclebf[24], 50);SetVehicleVirtualWorld(vehiclebf[25], 50);
SetVehicleVirtualWorld(vehiclebf[26], 50);SetVehicleVirtualWorld(vehiclebf[27], 50);
Why it keep spawning every 1 seconds?
Reply
#2

Quote:

AddStaticVehicleEx(432,624.9035000,908.9672000,-43.9785000,0.0000000,-1,-1,70)

You see the "70" in the last part?
That is the time in milliseconds each vehicle will re-spawn in.
Change them all to the time you need
Reply
#3

It's actually in seconds according to the wiki.
You must have a timer running somewhere in your code which respawns all vehicles every second.

Also, use a loop to set the virtual world:
pawn Код:
for (new i; i < sizeof(tank); i++)
    SetVehicleVirtualWorld(tank[i], 50);

for (new i; i < sizeof(vehiclebf); i++)
    SetVehicleVirtualWorld(vehiclebf[i], 50);
Much shorter and automatically uses extra added vehicles if you add some (increase the array-size and add vehicles, you don't even have to edit the loop).
Reply
#4

Quote:
Originally Posted by PowerPC603
Посмотреть сообщение
It's actually in seconds according to the wiki.
You must have a timer running somewhere in your code which respawns all vehicles every second.

Also, use a loop to set the virtual world:
pawn Код:
for (new i; i < sizeof(tank); i++)
    SetVehicleVirtualWorld(tank[i], 50);

for (new i; i < sizeof(vehiclebf); i++)
    SetVehicleVirtualWorld(vehiclebf[i], 50);
Much shorter and automatically uses extra added vehicles if you add some (increase the array-size and add vehicles, you don't even have to edit the loop).
Does this timer Repeating?
SetTimerEx("VehRes",4500,0,"i",vehicleid);

I dont have anything else.
Reply
#5

Oh yeah sorry it is seconds, not milliseconds
Quote:

SetTimerEx("VehRes",4500,0,"i",vehicleid);

Is that in your code?
if yes that would most probably be the problem...
Reply
#6

Its not a problem if not repeating , because its only destroy un used vehicle of player.
Reply
#7

bump
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)