wesleywillems17 Posted April 20, 2016 Share Posted April 20, 2016 Hello, I have downloaded a drug transport resource from the community. But it has some error's in the debug. Also when i hit the LSmarker with the CarLS then it gives me the money and wanted level from JobLS, jobLV and JobSF.. How could i fix this? i have tried a lot of thing but nothing works. (Sorry for bad English) Debug: [2016-04-21 00:08:05] ERROR: [gameplay]\(SARS)DugTrans\JobLS.lua:13: Valid wanted levels are between 0 and 6 inclusive [2016-04-21 00:08:05] ERROR: [gameplay]\(SARS)DugTrans\JobLV.lua:13: Valid wanted levels are between 0 and 6 inclusive [2016-04-21 00:08:05] WARNING: [gameplay]\(SARS)DugTrans\JobLV.lua:14: Bad argument @ 'destroyElement' [Expected element at argument 1, got nil] [2016-04-21 00:08:05] WARNING: [gameplay]\(SARS)DugTrans\JobLV.lua:15: Bad argument @ 'destroyElement' [Expected element at argument 1, got nil] [2016-04-21 00:08:05] WARNING: [gameplay]\(SARS)DugTrans\JobLV.lua:16: Bad argument @ 'destroyElement' [Expected element at argument 1, got nil] [2016-04-21 00:08:05] ERROR: [gameplay]\(SARS)DugTrans\JobSF.lua:13: Valid wanted levels are between 0 and 6 inclusive [2016-04-21 00:08:05] WARNING: [gameplay]\(SARS)DugTrans\JobSF.lua:14: Bad argument @ 'destroyElement' [Expected element at argument 1, got nil] [2016-04-21 00:08:06] WARNING: [gameplay]\(SARS)DugTrans\JobSF.lua:15: Bad argument @ 'destroyElement' [Expected element at argument 1, got nil] [2016-04-21 00:08:06] WARNING: [gameplay]\(SARS)DugTrans\JobSF.lua:16: Bad argument @ 'destroyElement' [Expected element at argument 1, got nil] Client.lua function guiMyCwindow(w,h,t) local x,y = guiGetScreenSize() return guiCreateWindow((x-w)/2,(y-h)/2,w,h,t,false) end transWindow = guiMyCwindow(320,350,"Drugs Transport") guiWindowSetMovable(transWindow,false) guiWindowSetSizable(transWindow,false) guiSetVisible(transWindow, false) destiLabel = guiCreateLabel(25,120,450,55,"Choose Your Destination:",false,transWindow) transInfo = guiCreateMemo(20,30,300,90,"What To Do?\n\nAs a drugs transporter it's your job to deliver\nthe drugs.\nYou must deliver the drugs to the destination that you have choosed here below.\n\nIf you step out of the vehicle then the vehicle will be destroyed!",false,transWindow) guiMemoSetReadOnly( transInfo, true ) lsButtonRadio = guiCreateRadioButton(20,140,437,45,"Travel To: Los Santos\n(+ 2 stars of wanted level)\nYou will earn $3000",false,transWindow) lvButtonRadio = guiCreateRadioButton(20,190,437,45,"Travel To Las Venturas\n(+ 4 stars of wanted level)\nYou will earn $6000",false,transWindow) sfButtonRadio = guiCreateRadioButton(20,240,437,45,"Travel to: San Fierro\n(+ 6 stars of wanted level)\nYou will earn $10.000",false,transWindow) acceptButton = guiCreateButton(22,300,108,37,"Accept",false,transWindow) closeButton = guiCreateButton(171,300,108,37,"Quit",false,transWindow) guiCreateLabel(144, 307, 20, 18, "OR",false,transWindow ) local jobmarker = createMarker ( 1612.52, -1500.88, 12.58, "cylinder", 2, 255, 0, 0, 255 ) function MarkerHit ( thePlayer, hitPlayer, matchingDimension ) if ( getTeamName(getPlayerTeam(thePlayer)) == "Criminal" ) then guiSetVisible(transWindow, true) showCursor(true) end end addEventHandler ( "onClientMarkerHit", jobmarker, MarkerHit ) function closeChangeJobWindow() if (source == closeButton) then guiSetVisible(transWindow, false) showCursor(false) end end addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), closeChangeJobWindow) function lsjobcli() if (source == acceptButton) then if (guiRadioButtonGetSelected(lsButtonRadio)) then triggerServerEvent ("givePlayerJobLS",getLocalPlayer()) guiSetVisible(transWindow, false) showCursor(false) end end end addEventHandler("onClientGUIClick", acceptButton, lsjobcli, false ) function lvjobcli() if (source == acceptButton) then if (guiRadioButtonGetSelected(lvButtonRadio)) then triggerServerEvent ("givePlayerJobLV",getLocalPlayer()) guiSetVisible(transWindow, false) showCursor(false) end end end addEventHandler("onClientGUIClick", acceptButton, lvjobcli, false ) function sfjobcli() if (source == acceptButton) then if (guiRadioButtonGetSelected(sfButtonRadio)) then triggerServerEvent ("givePlayerJobSF",getLocalPlayer()) guiSetVisible(transWindow, false) showCursor(false) end end end addEventHandler("onClientGUIClick", acceptButton, sfjobcli, false ) JobLS.lua function lsjobser () carLS = createVehicle (482, 1617.65, -1554.01, 13.56) warpPedIntoVehicle(source, carLS) markerLS = createMarker (1784.78, -1702.06, 12.50, "cylinder", 2, 255, 0, 0, 255) blipLS = createBlipAttachedTo (markerLS, 40) end addEvent ("givePlayerJobLS", true) addEventHandler ("givePlayerJobLS", root, lsjobser) function moneyLS (attackerLS) if (attackerLS) and (attackerLS ~= source) then givePlayerMoney(attackerLS, 3000) setPlayerWantedLevel(attackerLS, getPlayerWantedLevel(attackerLS)+2) destroyElement(markerLS) destroyElement(blipLS) destroyElement(carLS) end end addEventHandler( "onMarkerHit", root, moneyLS) JobLV.lua function lvjobser () carlv = createVehicle (482, 1606.96, -1554.01, 13.56) warpPedIntoVehicle(source, carlv) markerLV = createMarker (1074.43, 1292.71, 9.82, "cylinder", 2, 255, 0, 0, 255) blipLV = createBlipAttachedTo (markerLV, 40) end addEvent ("givePlayerJobLV", true) addEventHandler ("givePlayerJobLV", root, lvjobser) function moneyLV (attackerLV) if (attackerLV) and (attackerLV ~= source) then givePlayerMoney(attackerLV, 6000) setPlayerWantedLevel(attackerLV, getPlayerWantedLevel(attackerLV)+4) destroyElement ( markerLV ) destroyElement ( blipLV ) destroyElement ( carlv ) end end addEventHandler( "onMarkerHit", root, moneyLV ) JobSF.lua function sfjobser () carSF = createVehicle (482, 1597.13, -1554.01, 13.56) warpPedIntoVehicle(source, carSF) markerSF = createMarker (-2052.80, 144.87, 27.83, "cylinder", 2, 255, 0, 0, 255) blipSF = createBlipAttachedTo (markerSF, 40) end addEvent ("givePlayerJobSF", true) addEventHandler ("givePlayerJobSF", root, sfjobser) function moneySF (attackerSF) if (attackerSF) and (attackerSF ~= source) then givePlayerMoney(attackerSF, 10000) setPlayerWantedLevel(attackerSF, getPlayerWantedLevel(attackerSF)+6) destroyElement(markerSF) destroyElement(blipSF) destroyElement(carSF) end end addEventHandler( "onMarkerHit", root, moneySF ) Link to comment
Moderators IIYAMA Posted April 21, 2016 Moderators Share Posted April 21, 2016 This will fix those errors. [2016-04-21 00:08:05] ERROR: [gameplay]\(SARS)DugTrans\JobLS.lua:13: Valid wanted levels are between 0 and 6 inclusive setPlayerWantedLevel(attackerLV, math.min(getPlayerWantedLevel(attackerLV)+4, 6)) [2016-04-21 00:08:05] WARNING: [gameplay]\(SARS)DugTrans\JobLV.lua:14: Bad argument @ 'destroyElement' [Expected element at argument 1, got nil] [2016-04-21 00:08:05] WARNING: [gameplay]\(SARS)DugTrans\JobLV.lua:15: Bad argument @ 'destroyElement' [Expected element at argument 1, got nil] [2016-04-21 00:08:05] WARNING: [gameplay]\(SARS)DugTrans\JobLV.lua:16: Bad argument @ 'destroyElement' [Expected element at argument 1, got nil] if isElement(markerLV) then destroyElement ( markerLV ) end if isElement(blipLV) then destroyElement ( blipLV ) end if isElement(carlv) then destroyElement ( carlv ) end Also when i hit the LSmarker with the CarLS then it gives me the money and wanted level from JobLS, jobLV and JobSF.. But about this bug, you probably have to ask the owner to fix it. Because I am not going to check and rewrite the entire resource. 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