roellieboy6 Posted May 8, 2010 Share Posted May 8, 2010 Need help:( when i bought 2 car in shop 1 on buycar 1 and 1 on buycar2 he give on carspawn 1and2 the buycar2 and there is a warning in me Menu for getElementdata for car 1 and 2 pls help me he gives a WARNING the get elementdata i fault the problem 2 for vehicle2: if (getElementData (source, "hisCar1")) and (getElementType(getElementData (source, "vehicle1")) == "auto1") then shop function onClientGUIClick (button, state, absoluteX, absoluteYe) if (source == auto1) then guiSetVisible (carshopWindow, false) showCursor (false) if (guiGridListGetSelectedItem (carGridList)) then local carName1 = guiGridListGetItemText (carGridList, guiGridListGetSelectedItem (carGridList), 1) local carID1 = getVehicleModelFromName (carName1) local carCost1 = guiGridListGetItemText (carGridList, guiGridListGetSelectedItem (carGridList), 2) triggerServerEvent ("carShopCarBuy", getLocalPlayer(), carID1, carCost1, carName1) end elseif (source == closeButton) then guiSetVisible (carshopWindow, false) showCursor (false) end end addEventHandler ("onClientGUIClick", getRootElement(), onClientGUIClick) function onClientGUIClick (button, state, absoluteX, absoluteYe) if (source == auto2) then guiSetVisible (carshopWindow, false) showCursor (false) if (guiGridListGetSelectedItem (carGridList)) then local carName2 = guiGridListGetItemText (carGridList, guiGridListGetSelectedItem (carGridList), 1) local carID2 = getVehicleModelFromName (carName2) local carCost2 = guiGridListGetItemText (carGridList, guiGridListGetSelectedItem (carGridList), 2) triggerServerEvent ("carShopCarBuy1", getLocalPlayer(), carID2, carCost2, carName2) end elseif (source == closeButton) then guiSetVisible (carshopWindow, false) showCursor (false) end end addEventHandler ("onClientGUIClick", getRootElement(), onClientGUIClick) carShopMarker4 = createMarker (-1953.58, 298.74, 34.46875, "cylinder", 1.5, 255, 0, 0, 127) addEvent ("viewGUI4", true) function markerHit (hitPlayer, matchingDimension) if (source == carShopMarker4) then triggerClientEvent ("viewGUI4", hitPlayer) outputChatBox ("Welcome to the vehicleshop!", hitPlayer, 255, 0, 0) end end addEventHandler ("onMarkerHit", getRootElement(), markerHit) addEvent ("carShopCarBuy", true) addEventHandler ("carShopCarBuy", getRootElement(), function(id1, cost1, name1) if (getPlayerMoney (source) >= tonumber(cost1)) then outputChatBox ("Bought a " .. name1, source, 255, 255,255, false) outputChatBox ("ID1: " .. id1, source, 255, 0, 0, false) outputChatBox ("Cost1: " .. cost1, source, 255,255,255, false) takePlayerMoney (source, tonumber (cost1)) setAccountData (getPlayerAccount (source), "funmodev2-car", tonumber(id1)) setAccountData (getPlayerAccount (source), "funmodev2-paintjob", 3) setAccountData (getPlayerAccount (source), "funmodev2-carupg", 0) else outputChatBox ("You are too poor!", source, 255, 0, 0, false) end end) addEvent ("carShopCarBuy1", true) addEventHandler ("carShopCarBuy1", getRootElement(), function(id2, cost2, name2) if (getPlayerMoney (source) >= tonumber(cost2)) then outputChatBox ("Bought a " .. name2, source, 255, 255,255, false) outputChatBox ("ID2: " .. id2, source, 255, 0, 0, false) outputChatBox ("Cost2: " .. cost2, source, 255,255,255, false) takePlayerMoney (source, tonumber (cost2)) setAccountData (getPlayerAccount (source), "funmodev2-car", tonumber(id2)) setAccountData (getPlayerAccount (source), "funmodev2-paintjob", 3) setAccountData (getPlayerAccount (source), "funmodev2-carupg", 0) else outputChatBox ("You are too poor!", source, 255, 0, 0, false) end end) PLS HELP ME thx. Link to comment
dzek (varez) Posted May 8, 2010 Share Posted May 8, 2010 COOKIE2 here? ... This ISN'T YOUR SCRIPT! https://forum.multitheftauto.com/viewtop ... 39#p309739 Link to comment
Castillo Posted May 8, 2010 Share Posted May 8, 2010 COOKIE2 here?... This ISN'T YOUR SCRIPT! https://forum.multitheftauto.com/viewtop ... 39#p309739 actually he isnt COOKIE2, he is "wiebe" and this script isnt same as mine as you can see, is taked from j-rpg. Link to comment
roellieboy6 Posted May 8, 2010 Author Share Posted May 8, 2010 i know its from wiebe i must 2 post it for him but do you know what i must do u had the same problem so maybe you can help me sorry for my bad english !! Link to comment
Jason_Gregory Posted May 8, 2010 Share Posted May 8, 2010 Use the Lua Tags [lua][/lua] and whats the Console Error ? Link to comment
roellieboy6 Posted May 8, 2010 Author Share Posted May 8, 2010 i dont got a console error only a getelementdata warning and i use the [lua][/lua] already Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now