Hero192 Posted August 2, 2015 Posted August 2, 2015 Hey guys, It's a pickup mission, i want if the player wasted the pickup be at his dead location,i tried this way but failed: local locations = { { 1463.80, 2823.78, 10.82}, } local pos = locations[math.random(#locations)] local x,y,z = unpack ( pos ) BaseLV = createPickup(x, y, z-1, 3, 1210, 1, 1) addEventHandler( "onPlayerWasted", getRootElement( ), function() local x, y, z = getElementPosition ( BaseLV [ source ] ) local x, y, z = getElementPosition ( source ) BaseLV [ source ] = createPickup ( x, y, z-1, 3, 1210, 1, 1 ) end )
GTX Posted August 2, 2015 Posted August 2, 2015 Wtf? This doesn't make any sense. local BaseLV = {} addEventHandler( "onPlayerWasted", getRootElement( ), function() local x, y, z = getElementPosition ( source ) BaseLV [ source ] = createPickup ( x, y, z-1, 3, 1210, 1, 1 ) end )
Hero192 Posted August 2, 2015 Author Posted August 2, 2015 Thank you i'll try it out EDIT: I have another question i want to know how to make an Captcha, random code i mean like when you hit a marker you get GUI with an random code, you have to write it in the EditBox when you click ok the gate open, if its false then the gate won't open 2nd question,How to let an button write numbers in editbox, like a keyboard
GTX Posted August 2, 2015 Posted August 2, 2015 1: viewtopic.php?f=108&t=90687 2: I don't understand. You want only numbers to appear in editbox?
Hero192 Posted August 2, 2015 Author Posted August 2, 2015 2: I don't understand. You want only numbers to appear in editbox? Imagine you have a GUI with Buttons, each button you name it with a number, 1.2.3.4....etc And when you click on button with number One, "1" it write a Number in editbox, same for other nums By the way, i tried to use setElement data from client to server for destroy the blip but doesn't works --server side: local BaseLV = {} addEventHandler( "onPlayerWasted", getRootElement( ), function () local blp = getElementData(source, "blp") if not blp then return end destroyElement (blp) local x, y, z = getElementPosition ( source ) BaseLV = createPickup ( x, y, z, 3, 1210, 1, 1 ) end ) --client side: blp = createBlip(826.1767578125, 853.82403564453,10.948932647705, 51) setElementData(localPlayer,"blp",blp)
GTX Posted August 2, 2015 Posted August 2, 2015 Just create buttons, once you click on the button (onClientGUIClick), use guiSetText and edit the editbox. Try to do it. Why don't you use createBlip server side where onPlayerWasted is?
Hero192 Posted August 2, 2015 Author Posted August 2, 2015 Because im already using it in client side, it's just a part of blp not full code and if i created it in server side i'll have to use setElementdata again from server side to client..
GTX Posted August 2, 2015 Posted August 2, 2015 From what I see, the blip should be deleted. Debug your code like getElementType(getElementData(source, "blp"))
Hero192 Posted August 2, 2015 Author Posted August 2, 2015 You understood me by wrong i think, im using it in client side i just need to get the blip from client side to server to destroy it there --Client-side client = getLocalPlayer() function create () local mkr = createMarker(826.1767578125, 853.82403564453,10.948932647705, "cylinder", 2.0, 255,20, 23) blp = createBlip(826.1767578125, 853.82403564453,10.948932647705, 51) setElementData(localPlayer,"blp",blp) addEventHandler("onClientMarkerHit", mkr, Done) end addEvent("delivery" , true) addEventHandler("delivery ", client, create ) function Done(player, matching) if (player == localPlayer and matching) then triggerServerEvent(" doneJob", player ) addEventHandler("onClientRender",root,message) destroyElement(source) destroyElement(blp) end end
GTX Posted August 2, 2015 Posted August 2, 2015 Is blip even created? Your code looks fine, I can't help you from here.
Hero192 Posted August 2, 2015 Author Posted August 2, 2015 when i die it keep showing in map i want to destroy it
iMr.Dawix~# Posted August 2, 2015 Posted August 2, 2015 when i die it keep showing in map i want to destroy it try to use isElement then destroy the marker and the blip
KariiiM Posted August 2, 2015 Posted August 2, 2015 addEventHandler("onClientPlayerWasted", localPlayer, function() if isElement(blp) then destroyElement(blp) end if isElement(mkr) then removeEventHandler("onClientMarkerHit",mkr,Done) destroyElement(mkr) end end)
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