Guest Posted August 31, 2012 Share Posted August 31, 2012 Hello ! I have problem with my system packages. If i load the goods, and then discharge it in a designated place, script displays a message "To nie jest ten rozładunek" ("This is not the unloading"). Cod lua: source = getLocalPlayer() function closegui() guiSetVisible(GUIEditor_Window[1],false) showCursor(false) end outputChatBox("Skrypt wystartował!",255,0,0) local towar = 0 if towar == 0 then outputChatBox("Zmienna towar wynosi 0", 0, 255, 0) else outputChatBox("Zmienna towar nie wynosi 0.", 0, 255, 0) end GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Window[1] = guiCreateWindow(131,55,586,509,"",false) GUIEditor_Button[1] = guiCreateButton(23,42,130,32,"Trociny 0 Pkt.",false,GUIEditor_Window[1]) GUIGetText = guiCreateLabel ( 0.45,0.48, 0.10, 0.04,"Trociny",true,GUIEditor_Window[1] ) GUIEditor_Button[2] = guiCreateButton(18,383,550,54,"Zaladuj",false,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(130,454,332,46,"Zamknij",false,GUIEditor_Window[1]) addEventHandler( "onClientGUIClick", GUIEditor_Button[3], closegui ) guiSetVisible(GUIEditor_Window[1], false) local markers = { { -1725, -121, 2 }, {-1854, 1402, 6.1}, {-2282, 2278, 4,5}, {-367, 1547, 75,1}, {345, 2534, 16,2}, {1641, 2412, 10}, {-2887, 503, 4}, {-1515, 721, 6}, {-683, 965, 12}, {948, 2279, 11}, {1488, 2146, 10}, {1910, 2157, 10}, {2242, 1977, 9}, {-658, 2318, 138}, {-2054, -2565, 30}, {-1416, -1468, 101}, {-605, -483, 25}, {-55, -326, 5}, {1077, -307, 75}, {-2644, 1334, 7}, {2481, 2796, 10}, {-857, -1944, 15}, {-87, -1574, 2}, {-2264, -1688, 480}, { -2029.1010742188, 172.45364379883, 27.35425567627 } } local pmoney = getPlayerMoney(source) points = getElementData(getLocalPlayer(), "Pkt") local vehicle_ids = {[524] = true, [578] = true, [403] = true, [514] = true, [414] = true, [515] = true, [440] = true, [455] = true} -- Cement Truck, DFT-30, Linerunner, Tanker, Mule, RoadTrain, Rumpo, Flatbed dest = markers[math.random(1, #markers)] for k, v in ipairs (markers) do destmarker = createMarker(v[1], v[2], v[3], "cylinder", 3, 255, 255, 0, 255) pozmark = v[1] createBlip(v[1],v[2],v[3], 51) end function towary(hitElement) local vehicle = getPedOccupiedVehicle(hitElement) if vehicle then if vehicle_ids[getElementModel(vehicle)] then if towar == 0 then guiSetVisible(GUIEditor_Window[1], true) showCursor(true) else rozladunek() end else outputChatBox("To nie jest pojazd dostawczy!", 0, 255, 0) end else outputChatBox("Aby załadować towar musisz mieć pojazd dostawczy!", 0, 255, 0) end end addEventHandler( "onClientMarkerHit", getRootElement(), towary ) function rozladunek() if towar == 1 and pozmark == pozblip then setElementData(source,"Pkt",tonumber(Pkt + 1)) towar = 0 rmoney = math.random(350,700) givePlayerMoney ( source, rmoney ) outputChatBox("Rozładowałeś trociny!", player) else outputChatBox("To nie jest ten rozładunek!", 0, 255, 0) end end function towarTrociny() if points >= 0 and towar == 0 then towar = 1 outputChatBox("Załadowałeś trociny!", player) destblip = createBlip( dest[1], dest[2], dest[3], 41, 2, 255, 255, 0, 0, 100) pozblip = dest[1] else outputChatBox("Aby załadować ten towar musisz mieć minimum 0 punktów!", 0, 255, 0) end end addEventHandler( "onClientGUIClick", GUIEditor_Button[1], towarTrociny) I'm Polish, so i can't good speak english. Sorry for bad english! Link to comment
Guest Posted August 31, 2012 Share Posted August 31, 2012 I came up with a solution: isElementWithinMarker But it shows an error: Bad argument @ 'isElementWithinMarker' Link to comment
Renkon Posted August 31, 2012 Share Posted August 31, 2012 line 74, does vehicle_ids table exist? Link to comment
Guest Posted August 31, 2012 Share Posted August 31, 2012 System packages + scores: http://www.sendspace.pl/file/7debabbc81367b309fce5a2 Why script don't give player money and score ? PLS HELP ! 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