Hey,
ich habe in mein Selfmade Script ein mehr oder weniger dynamisches Tanksystem eingebaut. Dessen Array sieht so aus:
new Fahrzeugtank[212][0] = {
{"60"}, {"40"}, {"40"}, {"120"}, {"40"}, {"50"}, {"80"}, {"80"}, {"80"}, {"60"}, {"50"}, {"60"}, {"50"}, {"50"}, {"50"}, {"60"},
{"120"},{"150"}, {"50"}, {"40"}, {"40"}, {"40"}, {"50"}, {"30"}, {"80"}, {"120"}, {"50"}, {"120"}, {"90"}, {"60"}, {"90"}, {"60"}, {"40"}, {"70"}, {"60"}, {"0"},
{"50"}, {"60"}, {"40"}, {"50"}, {"40"}, {"0"}, {"40"}, {"80"}, {"30"}, {"50"}, {"100"}, {"150"}, {"20"}, {"0"}, {"0"}, {"60"}, {"120"}, {"80"}, {"200"}, {"80"}, {"80"},
{"20"}, {"50"}, {"40"}, {"90"}, {"40"}, {"30"}, {"45"}, {"0"}, {"0"}, {"50"}, {"50"}, {"40"}, {"120"}, {"80"}, {"40"}, {"100"}, {"20"}, {"50"}, {"40"}, {"90"}, {"60"}, {"40"}, {"40"}, {"80"}, {"0"},
{"40"}, {"40"}, {"180"}, {"10"}, {"30"}, {"150"}, {"120"}, {"80"}, {"80"}, {"50"}, {"40"}, {"120"}, {"150"}, {"40"}, {"30"},
{"150"}, {"40"}, {"40"}, {"40"}, {"0"}, {"60"}, {"60"}, {"40"}, {"50"}, {"60"}, {"40"}, {"40"},
{"0"}, {"0"}, {"200"}, {"100"}, {"80"}, {"120"}, {"100"}, {"40"}, {"40"}, {"40"}, {"250"}, {"80"}, {"30"}, {"30"}, {"30"}, {"40"}, {"50"}, {"40"}, {"40"}, {"80"}, {"40"},
{"10"}, {"20"}, {"40"}, {"50"}, {"40"}, {"40"}, {"40"}, {"0"}, {"0"}, {"40"}, {"40"}, {"60"}, {"45"}, {"40"}, {"80"}, {"40"}, {"40"}, {"40"}, {"180"},
{"40"}, {"40"}, {"40"}, {"50"}, {"120"}, {"50"}, {"45"}, {"20"}, {"20"}, {"50"}, {"50"}, {"50"}, {"50"}, {"50"}, {"120"}, {"0"}, {"40"}, {"40"}, {"50"}, {"0"}, {"0"},
{"0"}, {"10"}, {"20"}, {"40"}, {"20"}, {"40"}, {"30"}, {"400"}, {"70"}, {"40"}, {"40"}, {"30"}, {"40"}, {"15"}, {"0"}, {"40"},
{"30"}, {"40"}, {"30"}, {"30"}, {"0"}, {"0"}, {"600"}, {"100"}, {"0"}, {"90"}, {"80"}, {"80"}, {"80"}, {"60"}, {"40"}, {"80"}, {"50"},
{"40"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"50"}, {"0"}, {"0"}
};
Und der Stock zum abfragen:
stock GetVehicleTank(vehicleid) {
return strval(Fahrzeugtank[GetVehicleModel(vehicleid)-400]);
}
Das funktioniert soweit auch ganz gut. Allerdings werden die Fahrzeuge beim Spawnen nicht betankt. Unter OnVehicleSpawn habe ich folgendes:
Tank[vehicleid] = GetVehicleTank(vehicleid);
Die Tanks bleiben leer. Die gleiche Zeile habe ich jedoch auch in /afill (Also Fahrzeuge in denen man sitzt als Admin betanken) und da funktioniert es...
Ebenfalls habe ich das auch bei OnPlayerEnterVehicle, aber auch da tut sich nichts... Unter /veh zum spawnen auch: Fehlanzeige... Sogar unter OnGamemodeInit gehts nicht (Ok, da kann ich das teils nachvollziehen. Mit i (Definiert in der Max Vehicles For schleife) kann ich aber andere sachen der Fahrzeuge festlegen)
Weiß wer wieso?
Lg