Okay ich poste am besten einmal alles was ich bisher gemacht habe,
In der Datenbank hab ich das "Status" Feld anstatt mit Text auf Zahlen gebracht. (0 = Nicht abgeschleppt, 1 = abgeschleppt)
unter mysql_functions habe ich das hinzugefügt:
vioSetElementData ( vehicle, "status", dsatz["Status"] )
unter car_click habe ich das gemacht:
addEventHandler("onClientGUIClick", gButtons["vehinfo"],
function ()
local veh = vioClientGetElementData ( "clickedVehicle" )
if veh then
local owner = getElementData ( veh, "owner" )
if not owner or owner == "console" then
owner = "Niemand"
end
local stunings = sTuningsToString ( veh )
local abfrage = toabschleppstring ( veh )
outputChatBox ( "Fahrzeug Modell: "..getVehicleName (veh)..", Besitzer: "..owner, 200, 200, 255 )
outputChatBox ( "Tunings: "..stunings, 200, 200, 255 )
outputChatBox ( "Info: "..abfrage, 200, 200, 255 )
end
end
)
Alles anzeigen
und so sieht "toabschleppstring" aus:
function toabschleppstring( veh )
if getElementType (veh) == "vehicle" then
local sstring = ""
local status = getElementData ( veh,"status" )
if status == 0 then
sstring = "Nicht Abgeschleppt"
else
sstring = "Abgeschleppt"
end
end
end
Alles anzeigen
Folgenden Fehler bekomme ich:
car_click.lua:134: attempt to concatenate local 'abfrage' (a nil value)
Sprich der Wert ob das Fahrzeug Abgeschleppt ist, ist nul
@G4ngster
@Str1ker
@FFrozen