Cruze Posted August 29, 2015 Share Posted August 29, 2015 deliveryLocations = { {275, 1956, 17}, -- LV Military Forces HQ Base {-1303, 473, 7}, -- SF Naval Ship Base } rhinoLocations = { --LV {-685, 1195, 14}, {2542, 2853, 10}, --SF {-1742, 2445, 70}, {-1950, -1083, 30}, {-2071, -2437, 30}, --LS {2264, -2539, 8}, {679, -443, 16}, } function generateAV() local x, y, z = unpack(rhinoLocations[math.random(#rhinoLocations)]) avRhino = createVehicle(432, x, y, z+0.5) blip = createBlipAttachedTo(avRhino, 19) function onPlayerEnterTheAV(pla) local team = getPlayerTeam(pla) local teamName = getTeamName(team) if (teamName == "Criminals" or teamName == "Police" or teamName == "Military Forces" or teamName == "SWAT") then addEventHandler("onVehicleEnter", avRhino, generateDeliveryLocation) elseif (teamName ~= "Criminals" or teamName ~= "Police" or teamName ~= "Military Forces" or teamName ~= "SWAT") then outputChatBox("You cannot access this vehicle.", pla, 255, 0, 0) cancelEvent() end end addEventHandler("onVehicleStartEnter", avRhino, onPlayerEnterTheAV) end setTimer(generateAV, 5000, 1) function generateDeliveryLocation(pla) local x, y, z = unpack(deliveryLocations[math.random(#deliveryLocations)]) deliveryMarker = createMarker(x, y, z-1, "cylinder", 8, 255, 255, 0) locationBlip = createBlipAttachedTo(deliveryMarker, 19) rhinoDisarm = getPedOccupiedVehicle(pla) toggleControl("vehicle_fire", false) addEventHandler("onMarkerHit", deliveryMarker, generateRhinoPaymentMarker) end function generateRhinoPaymentMarker(pla) if (not isPedInVehicle(pla)) then return end rhino = getPedOccupiedVehicle(pla) x, y, z = getElementPosition(rhino) paymentMarker = createMarker(x + 1, y, z, 1, 255, 255, 0) setElementFrozen(rhino, true) addEventHandler("onMarkerHit", paymentMarker, payDeliveryService) end function payDeliveryService(pla) if (isPedInVehicle(pla)) then return end local team = getPlayerTeam(pla) local teamName = getTeamName(team) if (teamName ~= "Criminals" or teamName ~= "Police" or teamName ~= "Military Forces" or teamName ~= "SWAT") then return end outputChatBox("The NGC Law headquarters have decided to pay you for the service of protecting the lost Rhino! Grab your stash of money near the vehicle", pla, 255, 100, 194) givePlayerMoney(pla, 20000) destroyElement(paymentMarker) end [2015-08-30 00:20:22] WARNING: event\serverside.slua:42: Bad argument @ 'toggleControl' [Expected player at argument 1, got string 'vehicle_fire'][2015-08-30 00:21:31] WARNING: event\serverside.slua:52: Bad argument @ 'addEventHandler' [Expected element at argument 2, got boolean] [2015-08-30 00:21:31] WARNING: event\serverside.slua:47: Bad argument @ 'isPedInVehicle' [Expected ped at argument 1, got vehicle] ^ I don't know why I'm getting this. Link to comment
Noki Posted August 30, 2015 Share Posted August 30, 2015 Line 42: toggleControl(pla, "vehicle_fire", false) Line 47: Read up on onMarkerHit and its parameters. Maybe you could use onPlayerMarkerHit instead? Line 52: The marker returned false because your arguments are wrong. 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