Pickanothername Posted February 25, 2023 Share Posted February 25, 2023 function take(theElement) if getElementData(shape, "take") == "+" then -- How to check colShape date element from server side? if not isPedInVehicle then return end if (theElement == localPlayer) then local veh = getPedOccupiedVehicle(localPlayer) local model = getElementModel(veh) if model == 485 then triggerEvent("notiAdd", localPlayer, "success", "Done") else triggerEvent("notiAdd", localPlayer, "error", "Error") end end end end addEventHandler("onClientColShapeHit", root, take) How to getElementData colShape from server side? Link to comment
Mkl Posted February 25, 2023 Share Posted February 25, 2023 (edited) Hi -- theElement: the element that entered the colshape. -- The source of this event is the colshape that was hit. function take(theElement, matchingDimension) if not (theElement == localPlayer) then -- Checks whether the entering element is the local player return end if not (isPedInVehicle(localPlayer) then -- Checks if local player is not in a vehicle return end -- your colshape stuff if getElementData(source, "take") == "+" then -- source = colshape local veh = getPedOccupiedVehicle(localPlayer) local model = getElementModel(veh) if model == 485 then triggerEvent("notiAdd", localPlayer, "success", "Done") else triggerEvent("notiAdd", localPlayer, "error", "Error") end end end addEventHandler("onClientColShapeHit", root, take) Edited February 25, 2023 by Mkl 1 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