Hey Leute,
ich habe ein System gebastelt, welches die Fahrzeuge je nach Typ (Auto,Motorrad,Flugzeug,Helikopter oder Boot) an eine andere Koordinate spawnt.
Mein Problem ist, dass alle Fahrzeuge (egal ob Flugzeug, Auto usw.) an den gleichen Koordinaten spawnen bzw. dem gleichen Bereich.
Ich habe folgendes gemacht:
OnPlayerVehicleDeath:
new Float:RandomABSpawn[][4] =
{
{1804.3585,-1933.8682,13.0910,87.7785},
{1804.4644,-1925.3383,13.0949,87.3263},
{1804.6665,-1919.9371,13.0978,88.2095},
{1804.6288,-1913.5817,13.1013,83.2464},
{1805.0051,-1913.6602,13.1008,88.8116},
{1804.8402,-1905.2677,13.1050,88.1882},
{1777.4214,-1933.6216,13.1114,358.6562},
{1784.2065,-1933.5854,13.1056,358.1029},
{1790.6846,-1933.5505,13.1028,1.1505},
{1798.1012,-1933.3784,13.0887,3.6917}
};
new Float:RandomHSpawn[][4] =
{
{1996.1173,-2265.1396,13.5609,79.2195},
{1995.4329,-2256.2034,13.5455,78.9900},
{1994.9154,-2240.9492,13.5444,88.0144}
};
new Float:RandomFSpawn[][4] =
{
{1898.3033,-2393.7971,14.4581,180.0352},
{1897.5133,-2358.3367,14.4657,182.4402},
{1863.5999,-2394.7949,14.4735,172.4682},
{1803.9220,-2406.9189,14.4732,190.8047},
{1757.3746,-2456.6836,14.4763,90.9170}
};
new Float:RandomBOSpawn[][4] =
{
{946.6261,-1918.4954,-0.2348,107.9524},
{949.1671,-1932.1501,-0.2964,116.3820},
{953.0464,-1944.3909,-0.1249,121.6765},
{954.9921,-1971.4655,-0.4141,106.9405},
{957.4869,-1987.0812,-0.0946,93.0230}
};
if(!IsABoat(GetVehicleModel(vehicleid)))
{
new rand = random(sizeof(RandomBOSpawn));
FahrzeugInfo[i][fz_ID] = s_CreateVehicle(FahrzeugInfo[i][fz_Model],RandomBOSpawn[rand][0], RandomBOSpawn[rand][1],RandomBOSpawn[rand][2],RandomBOSpawn[rand][3],FahrzeugInfo[i][fz_Farbe1],FahrzeugInfo[i][fz_Farbe2],-1);
}
if(!IsAHeli(GetVehicleModel(vehicleid)))
{
new rand = random(sizeof(RandomHSpawn));
FahrzeugInfo[i][fz_ID] = s_CreateVehicle(FahrzeugInfo[i][fz_Model],RandomHSpawn[rand][0], RandomHSpawn[rand][1],RandomHSpawn[rand][2],RandomHSpawn[rand][3],FahrzeugInfo[i][fz_Farbe1],FahrzeugInfo[i][fz_Farbe2],-1);
}
if(!IsAFlugzeug(GetVehicleModel(vehicleid)))
{
new rand = random(sizeof(RandomFSpawn));
FahrzeugInfo[i][fz_ID] = s_CreateVehicle(FahrzeugInfo[i][fz_Model],RandomFSpawn[rand][0], RandomFSpawn[rand][1],RandomFSpawn[rand][2],RandomFSpawn[rand][3],FahrzeugInfo[i][fz_Farbe1],FahrzeugInfo[i][fz_Farbe2],-1);
}
if(!IsACar(GetVehicleModel(vehicleid)) || !IsABike(GetVehicleModel(vehicleid)))
{
new rand = random(sizeof(RandomABSpawn));
FahrzeugInfo[i][fz_ID] = s_CreateVehicle(FahrzeugInfo[i][fz_Model],RandomABSpawn[rand][0], RandomABSpawn[rand][1],RandomABSpawn[rand][2],RandomABSpawn[rand][3],FahrzeugInfo[i][fz_Farbe1],FahrzeugInfo[i][fz_Farbe2],-1);
}
Und die Stocks dazu:
stock IsAHeli(vehicleid)
{
if(vehicleid == 417 || vehicleid == 425 || vehicleid == 447 || vehicleid == 469 || vehicleid == 487 || vehicleid == 488 || vehicleid == 497 || vehicleid == 548 || vehicleid == 563)
{
return 1;
}
return 0;
}
stock IsABoat(vehicleid)
{
if(vehicleid == 430 || vehicleid == 446 || vehicleid == 452 || vehicleid == 453 || vehicleid == 454 || vehicleid == 472 || vehicleid == 473 || vehicleid == 484 || vehicleid == 493 || vehicleid == 595)
{
return 1;
}
return 0;
}
stock IsAFlugzeug(vehicleid)
{
if(vehicleid==417||vehicleid==425||vehicleid==447||vehicleid==460||vehicleid==469||vehicleid==476||vehicleid==487||vehicleid==488||vehicleid==497||vehicleid==511||vehicleid==512||vehicleid==513||vehicleid==519||vehicleid==520||vehicleid==548||vehicleid==553||vehicleid==563||vehicleid==577||vehicleid==592||vehicleid==593)return 1;
return 0;
}
stock IsACar(vehicleid)
{
if(vehicleid==400||vehicleid==401||vehicleid==402||vehicleid==404||vehicleid==405||vehicleid==409||vehicleid==410||vehicleid==411||vehicleid==412||vehicleid==413||vehicleid==414||vehicleid==415||vehicleid==416||vehicleid==418||vehicleid==419||vehicleid==420||vehicleid==421||vehicleid==422||vehicleid==423)return 1;
if(vehicleid==424||vehicleid==426||vehicleid==427||vehicleid==428||vehicleid==429||vehicleid==431||vehicleid==432||vehicleid==434||vehicleid==436||vehicleid==437||vehicleid==438||vehicleid==439||vehicleid==440||vehicleid==441||vehicleid==442||vehicleid==444||vehicleid==445||vehicleid==451||vehicleid==457)return 1;
if(vehicleid==458||vehicleid==459||vehicleid==466||vehicleid==467||vehicleid==470||vehicleid==474||vehicleid==475||vehicleid==477||vehicleid==478||vehicleid==479||vehicleid==480||vehicleid==482||vehicleid==483||vehicleid==489||vehicleid==490||vehicleid==491||vehicleid==492||vehicleid==494||vehicleid==495||vehicleid==496||vehicleid==498||vehicleid==499||vehicleid==500)return 1;
if(vehicleid==502||vehicleid==503||vehicleid==504||vehicleid==505||vehicleid==506||vehicleid==507||vehicleid==508||vehicleid==516||vehicleid==517||vehicleid==518||vehicleid==525||vehicleid==526||vehicleid==527||vehicleid==528||vehicleid==529||vehicleid==530||vehicleid==531||vehicleid==532||vehicleid==533||vehicleid==534||vehicleid==535||vehicleid==536||vehicleid==537)return 1;
if(vehicleid==589||vehicleid==596||vehicleid==597||vehicleid==598||vehicleid==599||vehicleid==600||vehicleid==601||vehicleid==602||vehicleid==603||vehicleid==604||vehicleid==605||vehicleid==609)return 1;
if(vehicleid==538||vehicleid==539||vehicleid==540||vehicleid==541||vehicleid==542||vehicleid==543||vehicleid==545||vehicleid==547||vehicleid==549||vehicleid==550||vehicleid==551||vehicleid==552||vehicleid==554||vehicleid==555||vehicleid==556||vehicleid==557||vehicleid==558||vehicleid==559||vehicleid==560)return 1;
if(vehicleid==561||vehicleid==562||vehicleid==565||vehicleid==566||vehicleid==567||vehicleid==568||vehicleid==569||vehicleid==570||vehicleid==571||vehicleid==572||vehicleid==575||vehicleid==576||vehicleid==579||vehicleid==580||vehicleid==582||vehicleid==583||vehicleid==585||vehicleid==587||vehicleid==588)return 1;
return 0;
}
stock IsABike(m)
{
if(m == 509 || m == 481 || m == 510 || m == 462 || m == 448 || m == 581 || m == 522 || m == 461 || m == 521 || m == 523)
{
return 1;
}
return 0;
}
Das Problem ist also, dass alle Fahrzeugtypen sobald sie zerstört sind bei einem der Koordinaten von "RandomABSpawn" spawnen...
Habe ich bei den Stocks was falsch gemacht oder fehlt etwas? :o