ich habe heute ersucht am godmother zu arbeiten, und da habe ich versucht einzubauen dass autos tanken müssen, aber das geht leider nicht und jetzt hab ich das problem und komme nicht mehr weiter
das script:
Lua
function buycar(theOwner,command,VehID,VehPrice,house)
if (lv_rlGetElementData(theOwner, "Slot1") == "Frei") then
freeslot = 1
elseif (lv_rlGetElementData(theOwner, "Slot2") == "Frei") then
freeslot = 2
elseif (lv_rlGetElementData(theOwner, "Slot3") == "Frei") then
freeslot = 3
elseif (lv_rlGetElementData(theOwner, "Slot4") == "Frei") then
freeslot = 4
elseif (lv_rlGetElementData(theOwner, "Slot5") == "Frei") then
freeslot = 5
elseif (lv_rlGetElementData(theOwner, "Slot6") == "Frei") then
freeslot = 6
elseif (lv_rlGetElementData(theOwner, "Slot7") == "Frei") then
freeslot = 7
elseif (lv_rlGetElementData(theOwner, "Slot8") == "Frei") then
freeslot = 8
elseif (lv_rlGetElementData(theOwner, "Slot9") == "Frei") then
freeslot = 9
elseif (lv_rlGetElementData(theOwner, "Slot10") == "Frei") then
freeslot = 10
else
freeslot = nil
end
if (freeslot ~= nil) then
if (getPlayerMoney(theOwner) < tonumber(VehPrice)) then
outputChatBox("Du hast nicht genug Geld um dir dieses Auto zu kaufen!", theOwner,255,0,0)
else
takePlayerMoney(theOwner, VehPrice)
-------_autohaus
if (house == 1) then
tabler1 = mysql_query(sqlcon, "INSERT INTO car_data (VehID, Owner, Ownerslot, X, Y, Z, RX, RY, RZ, Tuning, VColors, LColors, Benzin, distance) VALUES ('"..VehID.."', '"..getPlayerName(theOwner).."', '"..freeslot.."', '"..(2170.1999511719).."', '"..(1398).."', '"..(10.800000190735).."', '"..(0).."', '"..(0).."', '"..(0).."', '0|0|0|0|0|0|0|0', '0|0|0|0', '255|255|255'),'"..(100).."','"..(0).."'")
elseif (house ==2) then
tabler1 = mysql_query(sqlcon, "INSERT INTO car_data (VehID, Owner, Ownerslot, X, Y, Z, RX, RY, RZ, Tuning, VColors, LColors,Benzin, distance) VALUES ('"..VehID.."', '"..getPlayerName(theOwner).."', '"..freeslot.."', '"..(-2215.7192382813).."', '"..(2437.7009277344).."', '"..(0).."', '"..(0).."', '"..(0).."', '"..(176.94580078125).."', '0|0|0|0|0|0|0|0', '0|0|0|0', '255|255|255'),'"..(100).."','"..(0).."'")
--Bluberry autohaus
elseif (house == 0) or (house == nil) or (house == false) then
tabler1 = mysql_query(sqlcon, "INSERT INTO car_data (VehID, Owner, Ownerslot, X, Y, Z, RX, RY, RZ, Tuning, VColors, LColors, Benzin, distance) VALUES ('"..VehID.."', '"..getPlayerName(theOwner).."', '"..freeslot.."', '"..(2170.1999511719).."', '"..(1398).."', '"..(10.800000190735).."', '"..(0).."', '"..(0).."', '"..(0).."', '0|0|0|0|0|0|0|0', '0|0|0|0', '255|255|255'),'"..(100).."','"..(0).."'")
end
mysql_free_result ( tabler1 )
tabler = mysql_query(sqlcon, "SELECT * FROM car_data WHERE `Owner` = '"..getPlayerName(theOwner).."' AND `OwnerSlot` = '"..freeslot.."'");
if (tabler) then
if(mysql_num_rows(tabler) > 0) then
newTable = mysql_fetch_assoc(tabler)
local Besitzer = newTable["Owner"]
local Modell = newTable["VehID"]
local Tuning = newTable["Tuning"]
local Spawn_X = tonumber(newTable["X"])
local Spawn_Y = tonumber(newTable["Y"])
local Spawn_Z = tonumber(newTable["Z"])
local Spawn_RX = tonumber(newTable["RX"])
local Spawn_RY = tonumber(newTable["RY"])
local Spawn_RZ = tonumber(newTable["RZ"])
local OwnerSlot = newTable["Ownerslot"]
local Farbe = newTable["VColor"]
local Benzin = newTable["Benzin"]
local distance = newTable["distance"]
_G["UserAuto"..Besitzer..OwnerSlot] = createVehicle( Modell, Spawn_X, Spawn_Y, Spawn_Z,Spawn_RX, Spawn_RY, Spawn_RZ, Besitzer )
local veh = _G["UserAuto"..Besitzer..OwnerSlot]
setVehicleRotation ( veh, Spawn_RX, Spawn_RY, Spawn_RZ )
lv_rlSetElementData ( veh, "Owner", Besitzer )
lv_rlSetElementData ( veh, "OwnerSlot", OwnerSlot )
setVehicleLocked ( veh, true )
lv_rlSetElementData(theOwner,"Slot"..tostring(freeslot).."",newTable["ID"])
warpPedIntoVehicle(theOwner, veh, 0)
end
mysql_free_result ( tabler )
end
end
else
outputChatBox("Du hast keinen Slot mehr frei!", theOwner, 255,0,0)
end
end
addEvent("BuyCar", true)
addEventHandler("BuyCar", getRootElement(), buycar)
Alles anzeigen
hier die db-struktur:
SQL
CREATE TABLE IF NOT EXISTS `car_data` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`VehID` int(11) DEFAULT NULL,
`Owner` text,
`Ownerslot` text,
`X` double DEFAULT NULL,
`Y` double DEFAULT NULL,
`Z` double DEFAULT NULL,
`RX` double DEFAULT NULL,
`RY` double DEFAULT NULL,
`RZ` double DEFAULT NULL,
`Tuning` text,
`VColors` text,
`LColors` text,
`Benzin` text NOT NULL,
`Distance` double NOT NULL DEFAULT '0',
PRIMARY KEY (`ID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
Alles anzeigen
und hier das bild mit dem error
Externer Inhalt
www11.pic-upload.de
Inhalte von externen Seiten werden ohne Ihre Zustimmung nicht automatisch geladen und angezeigt.