Hallo ich habe ein kleines Script geschrieben welches Fahrzeuge spawned und nun möchte ich eine abfrage einbauen ob man schon in einem auto ist und wenn ja das dieses zerstört wird und danach man erst das neue erstellt bekommt aber das bekomme ich iwie nicht hin
Code
function getcar (source, cmd, car)
if car == "nrg" then
local x, y, z = getElementPosition( source )
local Car = createVehicle(522, x, y, z)
warpPedIntoVehicle(source, Car)
outputChatBox("Du hast dir erfolgreich eine NRG gegeben!", source, 20, 255, 0)
elseif car == "infernus" then
local x, y, z = getElementPosition( source )
local Car = createVehicle(411, x, y, z)
warpPedIntoVehicle(source, Car)
outputChatBox("Du hast dir erfolgreich einen Infernus gegeben!", source, 20, 255, 0)
elseif car == "info" then
outputChatBox("Liste aktueller Fahrzeuge:", source, 20, 255, 0)
outputChatBox("Cars: infernus", source, 20, 255, 0)
outputChatBox("Bikes: nrg", source, 20, 255, 0)
else
outputChatBox("[Fehler] Bitte gebe /car Fahrzeugname ein!", source, 255, 0, 0)
outputChatBox("[Fehler] Gebe /car info für eine Liste der Fahrzeuge ein!", source, 255, 0, 0)
end
return true
end
addCommandHandler("car", getcar)
Alles anzeigen