hier ist mein code:
das auto in dem ich sitze wird nicht repariert, aber warum nicht ?
Lua
function vehrep (source,vehicle)
local playerX,playerY,playerZ = getElementPosition(source)
tankstelleX,tankstelleY,tankstelleZ = 122,181,0.5
local distanz = getDistanceBetweenPoints3D(playerX,playerY,playerZ,tankstelleX,tankstelleY,tankstelleZ)
local money = getPlayerMoney(source)
local auto = isPlayerInVehicle(source)
if distanz <= 40 then
if auto then
if money >= 1000 then
outputChatBox("Fahrzeug repariert. Kosten 1000$",getRootElement(),0,128,255,true,player)
takePlayerMoney(source,1000)
fixVehicle(source)
else
outputChatBox("Du hast nicht genug Geld.",getRootElement(),255,128,0,true,player)
end
else
outputChatBox("Du befindest dich nicht in einem Fahrzeug.",getRootElement(),255,128,0,true,player)
end
else
outputChatBox("Du bist nicht nahe genug an der Tankstelle.",getRootElement(),255,128,0,true,player)
end
end
addCommandHandler("rep",vehrep)
Alles anzeigen