Jump to content

Z4Zy

Members
  • Posts

    215
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Z4Zy

  1. put "else" on that "if" statement. so that the lines from 10 to 18 looks like below, addEventHandler("onVehicleEnter", root, function (p, s) if source == a and s == 0 then cuboid = createMarker ( 0, 0,0, "cylinder",50, 255, 255, 255,0 ) triggerClientEvent(p, "complete",p) exports.ISGMessages:sendClientMessage("Andromada: mission has been started deliver it to SF",p,0,255,0) attachElements ( cuboid ,source, 0, 0,-2 ) marker = createMarker(-1243.03, -191.14, 13.14,"cylinder",5,255,0,255,255,getRootElement()) else outputChatBox("Error Is Here !",p) end end)
  2. To create the cuboid and attach it, source must equals to the "a" and s must be "0". make sure they are right !
  3. Hey buddy ! The code you've mentioned is return the world position of the element. But I want to return the offset positions of the element relevant to the attached-to element. Can you ?
  4. what do you mean by visibility to him ?
  5. Hi ! I think that the answer you are finding is already in dxDraw functions. All you have to do is set the value of argument of dxDraw function called postGUI to true. When postGUI is true, dxDraw will always be in front of every GUI element. If postGUI is false dxDraw always be behind any GUI element.
  6. Hello friends ! Aren't there any easy way to get the offset position of X, Y and Z of an attaching element, that can be used as "attachElements" function's arguments ? Please tell me a way if you know.
  7. Okay ! but setting setCameraTarget on onClientRender is Inappropriate
  8. It is more useful if you can supply the code that you are used !
  9. did you parse this code in client side ? and are there any error appears in debugscript ?
  10. so .. when checking that the "hitelement" is localplayer, "onClientRender" event gets the root element as localPlayer isn't it ?
  11. And this is also client side :- local screenW, screenH = guiGetScreenSize() local marker = createMarker( 0, 0, 2, "cylinder", 2, 255, 255, 0, 255 ) function drawAlert() dxDrawText("You Hit The Marker", (screenW - 340) / 2, (screenH - 53) / 2, ((screenW - 340) / 2) + 340, ( (screenH - 53) / 2) + 53, tocolor(255, 0, 0, 255), 3.00, "default", "left", "top", false, false, false, false, false) dxDrawLine(296, 358, 719, 358, tocolor(32, 222, 55, 255), 1, false) dxDrawLine(296, 411, 719, 411, tocolor(32, 222, 55, 255), 1, false) end function onMarkerHit() addEventHandler("onClientRender", root, drawAlert) end addEventHandler("onClientMarkerHit", marker, onMarkerHit) function onMarkerLeave() removeEventHandler("onClientRender", root, drawAlert) end addEventHandler("onClientMarkerLeave", marker, onMarkerLeave) Why is client's root element changed in this code that leads render to everyone ?
  12. But where it says that root element of an event can be change
  13. Z4Zy

    isPedDoingTask

    Hey ! "setPedStat" has some options to change player's jumping stats under 139 and 140. Check it out !
  14. Z4Zy

    isPedDoingTask

    Hi ! If you are looking for extra jump power when player takes the drug, then I suggest you to use the function "setWorldSpecialPropertyEnabled" in this occasion to enable / disable player's extra jump property. setWorldSpecialPropertyEnabled("extrajump",true) -- enable power setWorldSpecialPropertyEnabled("extrajump",false) -- disable power And this is client side and you shouldn't run this by the event "onClientRender"
  15. An example is already added in the engineLoadIFP page that synchronize animations called ifp_demo. It's work correctly thus everyone will see the animation. Check it out @Siri
  16. Go and read this, https://wiki.multitheftauto.com/wiki/BindKey bindKey is a shared function. So, it can be use in both client and server sides. Better to refer above wiki link for more info + examples.
  17. Z4Zy

    Help please

    To create a dxDrawText appears after 1 sec and disappears after 2 sec, you need to use setTimer function. + It is possible to make the dxDrawText appears only in specified dimension... For this, You need to check player's dimension with the function getElementDimension functions with dxDrawText must be handled with the below event. onClientRender And note that this should be a Client Side Script.
  18. Are you sure that this trick will work ? because if the hitElement was the localPlayer, drawAlert function will render to root element means all players ?!?!
  19. So, I just created below code. Client Side Code :- local screenW, screenH = guiGetScreenSize() local marker = createMarker( 0, 0, 2, "cylinder", 2, 255, 255, 0, 255 ) function drawAlert() dxDrawText("You Hit The Marker", (screenW - 340) / 2, (screenH - 53) / 2, ((screenW - 340) / 2) + 340, ( (screenH - 53) / 2) + 53, tocolor(255, 0, 0, 255), 3.00, "default", "left", "top", false, false, false, false, false) dxDrawLine(296, 358, 719, 358, tocolor(32, 222, 55, 255), 1, false) dxDrawLine(296, 411, 719, 411, tocolor(32, 222, 55, 255), 1, false) end function onMarkerHit() addEventHandler("onClientRender", root, drawAlert) end addEventHandler("onClientMarkerHit", marker, onMarkerHit) function onMarkerLeave() removeEventHandler("onClientRender", root, drawAlert) end addEventHandler("onClientMarkerLeave", marker, onMarkerLeave) The problem is that, since onClientRender event use root, when one player hit the marker, alert [ drawAlert function ] will draw on all players' screen ! How to draw that alert [ drawAlert function ] only on marker hit player's screen ??
  20. Z4Zy

    Lua f*k sh*t

    setElementData(source, "countCheckpoitBusRoad", 0) -- somewhere in the code local countCheckpoint = getElementData(player, "countCheckpoitBusRoad") -- this is a local variable setElementData(player, "countCheckpoitBusRoad", countCheckpoint + 1) -- set element's data to the current value + 1
  21. Bro, what is the relationship between 'isElementWithinMarker' and 'setElementData' ? I want to insert multiple values to one key of an element's data. Marker code is only an example use to describe problem. Think we create a script like this, There are some markers that we have created. When an element / player hit a marker, his key called "hitMarkers" will be added new value. local a = createMarker(bla,bla,bla) local b = createMarker(bla,bla,bla) local c = createMarker(bla,bla,bla) addEventHandler("onMarkerHit", root, function (player) if (source == a) then setElementData(player,"hitMarkers","a") -- on hit marker a set Value to "a" elseif (source == b) then setElementData(player,"hitMarkers",????) -- if I write this line as setElementData(player,"hitMarkers","b"), it will remove the current value and replace new value. How to add "b" without remove previous value ? end )
  22. Hi Friends ! Again, I've fall into a big hole . So, I'm requesting you to help me to come outside this hole by answering this problem . The problem is mentioned below, We use 'setElementData' to store some data in a element like below, local marker = createMarker(0,0,5,"cylinder",1.5,255,255,0,255) addEventHandler("onMarkerHit", marker, function (hitter) setElementData(hitter,"isInsideMarker","yes") end ) addEventHandler("onMarkerLeave", marker, function (leaver) setElementData(leaver,"isInsideMarker","no") end ) as you can see, when element hit the marker, we set it's data called "isInsideMarker", the value "yes". when leave, element's data "isInsideMarker" set to the value "no". Simple idea ! So, in this occasion, "isInsideMarker" data gets only the value "yes" and "no". It successfully store only one value at one time. So, my problem is, how to store multiple values set in one element's data ? [ it may be using a table or ..ect ] can you describe me how to store multiple values in one element data ?
  23. when isActive == true , it means that command is added. And isActive == false means commands is not added. When you add the command using addCommandHandler, you should change the value of isActive to true. when removing the command, value of isActive should change to false. isActive variable is created by us. So, it doesn't change automatically. we should manually change it, Like below. local isActive = false -- initial value of "isActive" if ( isActive == true ) then -- if true killTimer(Timer10) -- function isActive = false -- change value to false elseif ( isActive == false ) then --else if false addCommandHandler("usemedkit", usemedkits) -- function killTimer(Timer10) isActive = true -- change valu to true end
  24. Or you can run a local variable with this. I mean, when you add this command, give a variable the value true. when the command is removed, give it the value false. local isActive = false -- our local variable. it's currently in false state if ( isActive == true ) then -- if variable's value = true removeCommandHandler("usemedkit") -- remove command isActive = false -- and value of variable is false elseif ( isActive == false ) then -- if variable's value already false addCommandHandler("usemedkit", usemedkits) -- then add command -- isActive = true -- variable is now true state -- end
×
×
  • Create New...