-
Posts
696 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Dzsozi (h03)
-
Sorry for not replying, I forgot about this post. But it's still not working. My camera still goes up when I get wasted.
-
Oh, nevermind, I fixed it! Thank you for your help guys!
-
But how can I fix this function? If I write source the script is not working, my position is not changing, there's no text in the chatbox, etc. How can I fix this, so only the player who clicks yes can be triggered with the marker, set a new position, take the parachute, etc. Could you help me please?
-
I made it in other way. Now my only problem is that when I write localPlayer and not source it will be always a failure, and everyone gets a message. But if I write source the script is not working. How can I check "name" the player who clicked on the yes button? So the script would react only with this player who clicked on the gui element. function landingMarker() parachuteLandMarker = createMarker(1753.0849609375, -2544.6044921875, 13, "cylinder", 5, 255, 0, 0, 125) parachuteLandMarkerBlip = createBlipAttachedTo(parachuteLandMarker, 0, 3, 255, 255, 0, 255) --elseif isPlayerOnGround (localPlayer) and not isElementWithinMarker(localPlayer, parachuteLandMarker) then --outputChatBox("failure") check = setTimer ( function() if isElementWithinMarker(source, parachuteLandMarker) and isPlayerOnGround (source) then outputChatBox("succes") triggerServerEvent('takeParachuteFromPlayer', source) setElementPosition(source, 1953.3623046875, -2219.1474609375, 13.546875) destroyElement(parachuteLandMarkerBlip) destroyElement(parachuteLandMarker) setElementFrozen(source, false) elseif isPlayerOnGround (source) and not isElementWithinMarker(source, parachuteLandMarker) then outputChatBox("failure") triggerServerEvent('takeParachuteFromPlayer', source) setElementPosition(source, 1953.3623046875, -2219.1474609375, 13.546875) destroyElement(parachuteLandMarkerBlip) destroyElement(parachuteLandMarker) setElementFrozen(source, false) end end, 2000, 0 ) end Please help me! I would appreciate it!
-
https://community.multitheftauto.com/ind ... ls&id=9403 https://community.multitheftauto.com/ind ... ls&id=9401 Same pictures and no description DONE
-
This function is for attaching blips, not for elements, for example the object and the marker. For moving you can use "moveObject" and for attaching the attach function you wrote. //From phone
-
Okay, I've done something, but I can't find a better way. Does someone know something better? The problem is that it only triggers when you hit the marker, so there will be only a failure if someone leaves the marker. function landingMarker() parachuteLandMarker = createMarker(1948.9521484375, -2273.642578125, 13, "cylinder", 5, 255, 0, 0, 125) parachuteLandMarkerBlip = createBlipAttachedTo(parachuteLandMarker, 0, 3, 255, 255, 255, 255) if isPlayerOnGround (localPlayer) then --elseif isPlayerOnGround (localPlayer) and not isElementWithinMarker(localPlayer, parachuteLandMarker) then --outputChatBox("failure") addEventHandler("onClientMarkerHit", parachuteLandMarker, function() check = setTimer ( function() setElementFrozen(localPlayer, true) if isElementWithinMarker(localPlayer, parachuteLandMarker) then fadeCamera(false, 2) outputChatBox("succes") setElementFrozen(localPlayer, false) resetPosition() else fadeCamera(false, 2) killTimer(check) outputChatBox("failure") setElementFrozen(localPlayer, false) resetPosition() end end, 5000, 1 ) end ) end end The reason why I made the marker inside the function because I'm triggering it with the yesBtn.
-
You Can Try with this , https://wiki.multitheftauto.com/wiki/Is ... thinMarker That's what I wanted to try, but thanks!
-
Okay, thanks! I have an idea how to do this. I'm going to freeze the player after five seconds when be hit the marker, after five seconds if he's still in the marker it will be succes, else if he's outside it will be a failure. I Think it's gonna work, thank you! Will try jt or something like that.
-
Okay, I will try that, but how can I check if the player is in the ground but not in the marker? With the last posted script it wasn't output "failure", just "succes" when I walked into the marker. So how can I check if the player is not in the marker but on the ground?
-
Well, how could I make a marker or something like that to check if the player is already landed, and if the player is landed then how can I check if he's landed in the correct position, else if he isn't at the right place then output a text or something? Is this possible somehow? P.S.: Sorry for the bad English!
-
Okay, I made it thanks! But I still have questions. How can I check if the player if already landed in a marker? I made a function but it doesn't seems to work. What could be the problem? function landingMarker() parachuteLandMarker = createMarker(1978.2177734375, -2352.3857421875, 13, "cylinder", 10, 255, 0, 0, 255) if isPlayerOnGround (localPlayer) then if isElementWithinMarker(localPlayer, parachuteLandMarker) then outputChatBox("succes") else outputChatBox("failure") end end end addEventHandler("onClientMarkerHit", parachuteLandMarker, landingMarker)
-
Great idea, thanks! And is this possible to smoothly rotate the object? Like the plane is landing off?
-
I have another question. How can I make a plane, make the camera attached to it and make it fly, but without driver or with an NPC? I just want to create a little scene where a plane goes up, but my code don't seems to work. I created this in client side, but it only creates the Dodo plane and sets the camera attached to it, but it's engine is off and it's not going forward or up. How can I fix it? function airplane() cam = getCamera() setElementPosition(cam, 0, 0, 0) plane = createVehicle(593, 1980.15234375, -2493.7978515625, 13.53911781311) attachElements( cam, plane, 0,-4,2, -20,0,0 ) setControlState ( "accelerate", true ) setVehicleEngineState ( plane, true ) end
-
It's working, thank you guys!
-
Umm, now I have another problem. I tried to trigger again, but I don't understand it. Someone could explain it for me? I have this in client side: function acceptParachute() triggerServerEvent("giveParachuteForPlayer", getLocalPlayer()) end And this in server side: function parachute(hitElement) giveWeapon(hitElement, 46, 1) setElementPosition(hitElement, 1954.33984375, -2224.9919433594, 16.678098678589) end addEvent("giveParachuteForPlayer", true) addEventHandler("giveParachuteForPlayer", getRootElement(), parachute) It should give me a parachute and set my position to the given coordinates when I click on Yes, but noting happens. Why?
-
Thank you guys! I appreciate it!
-
Hello guys, I have a little problem that I can't fix. I want to create a parachuting script, I made the GUI for it and I made a bit of the server side. My problem is that I don't know how to trigger the GUI for the player who goes into the marker, and also it outputs 'test' for everyone, not for the hitElement. What could be the problem? I would be grateful if someone could help me! Client side: function drawGui() window = guiCreateWindow(697, 440, 511, 205, "parachute", false) guiWindowSetSizable(window, false) yesBtn = guiCreateButton(110, 87, 89, 88, "yes", false, window) guiSetProperty(yesBtn, "NormalTextColour", "FFAAAAAA") noBtn = guiCreateButton(309, 87, 89, 88, "no", false, window) guiSetProperty(noBtn, "NormalTextColour", "FFAAAAAA") lbl = guiCreateLabel(74, 28, 350, 49, "?", false, window) guiLabelSetHorizontalAlign(lbl, "center", false) guiLabelSetVerticalAlign(lbl, "center") end addEvent("showParachuteGUI", true) addEventHandler("showParachuteGUI", getRootElement(), drawGui) function removeGui() if (guiGetVisible(window) == true) then destroyElement(window) end end Server side: parachuteMarker = createMarker(1948.7705078125, -2225.1472167969, 13, "cylinder", 1.5, 255, 255, 0, 125) function markerHit() if (source == parachuteMarker) then outputChatBox("test", hitElement) triggerClientEvent("showParachuteGUI", hitElement) end end addEventHandler("onMarkerHit", parachuteMarker, markerHit) Thanks in advance!
-
It's still not working, I removed commandName from server side function arguments, but still not working. What could be the problem?
-
It's still not working.
-
Hello guys! I have the basketball that you can download from community and I want to edit this a little bit. I want it work with gui, so you can pickup the ball by clicking on a button. My only problem is that it doesn't want to work in the way I want to and I can't fix it. Where is the problem? When the button appears and if I click it nothing happens. Can anybody help me please? Client side script: local x, y = guiGetScreenSize() function drawNotice( ) pickupBtn = guiCreateButton(x-208, y-215, 50, 50, "Pick up", false) addEventHandler("onClientGuiClick", pickupBtn, pickup) end addEvent("notify:basket", true) addEventHandler("notify:basket", getLocalPlayer(), drawNotice) function removeNotice( ) guiSetVisible(pickupBtn, false) end addEvent("removenotify:basket", true) addEventHandler("removenotify:basket", getLocalPlayer(), removeNotice) function pickup( thePlayer ) triggerServerEvent(root, "pickupBall", thePlayer) end The pickupBall function from the server side script: function pickupBall( thePlayer, commandName ) if (isElementWithinColShape(thePlayer, ballCol1) or isElementWithinColShape(thePlayer, ballCol2) or isElementWithinColShape(thePlayer, ballCol3) or isElementWithinColShape(thePlayer, ballCol4)) then exports.global:applyAnimation( thePlayer, "BSKTBALL", "BBALL_pickup", 1000, false, true, true) exports['anticheat-system']:changeProtectedElementDataEx(thePlayer, "throwing:ball", 0, true) setTimer(function() local playerX, playerY, playerZ = getElementPosition( thePlayer ) local basketball = createObject(3065, playerX, playerY, playerZ) ball[thePlayer] = basketball -- Place the ball near his right hand attachElements( ball[thePlayer], thePlayer, 0.40, .30, -0.10) -- Animation exports.global:applyAnimation( thePlayer, "BSKTBALL", "BBALL_walk", -1, true, true, true) -- He is playing.. exports['anticheat-system']:changeProtectedElementDataEx(thePlayer, "playing:ball", 1, true) -- Start dribbling dribbleDown( thePlayer ) -- Movement binds bindKey(thePlayer, "a", "down", turnLeft) bindKey(thePlayer, "a", "up", stopLeft) bindKey(thePlayer, "d", "down", turnRight) bindKey(thePlayer, "d", "up", stopRight) bindKey(thePlayer, "w", "down", run) bindKey(thePlayer, "s", "down", walk) -- Shoot binds bindKey(thePlayer, "mouse2", "down", shootShort) bindKey(thePlayer, "mouse1", "down", shootMedium) bindKey(thePlayer, "h", "down", shootLong) -- Pass bindKey(thePlayer, "z", "down", passBall) bindKey(thePlayer, "x", "down", passStance) -- Run/walk identifiers exports['anticheat-system']:changeProtectedElementDataEx(thePlayer, "basketball:walk", 1, true) end, 1500, 1) end end addEventHandler("pickupBall", true) addEventHandler("pickupBall", thePlayer, pickupBall) So how can I make it work with gui? Thanks in advance!
-
Nevermind, I fixed it! Anyways, thanks!
-
Okay, so I made a script, but my problem is that I don't know how to get the player's sprint key. So for example my sprint is binded to left shift, but other players have other binds, for example my friend's sprint key is space. How can I get the sprint button and bind it? So everyone can use it with their binds. Right now I have this: bindKey( "lshift", "both", function () if getKeyState("lshift") == true then setControlState ( "walk", false ) setControlState ( "sprint", false ) outputChatBox("jogging") elseif getKeyState("lshift") == false then setControlState ( "walk", true ) setControlState ( "sprint", false ) outputChatBox("walking") end end ) And I want to make the script work like if you keep pressing the sprint button the character starts to sprint, but if you just hold it your character will be jogging and if you don't hold or press it then your character just simply walks. Can anybody help me in this please?
-
Okay, I will try some of thesee, thank you guys!
-
But the markers are in server side. Or how can I get the "name" of the server side marker in client side? For example, in server side the marker is being created like: exampleMarker = createMarker( ... ) So how can I get the name exampleMarker in client side to get the element data of it?