Jump to content

Hero192

Members
  • Posts

    512
  • Joined

  • Last visited

Everything posted by Hero192

  1. I already using this function, I just want to add my script in more shops but to do that, I need a way to define each ped that got aimed to be able to get shop position. Like if I aim on ped in shop ls the player will return the cordination of shop ls, because I want to make a distance system for each shop. Like need to walk 200 meters far of shop to get paid. Well i think I had explained it well please anyone can show me the right way?
  2. Well so I have a last question, how to get shop's position for each ped aimed on. For example: If I aim on the ped who exist in shop A, the script will get distance of shop A..etc Just give me a way to follow please
  3. Alright, Is there's a way to check how many meters left to complet 200meters? if yes please tell me the way
  4. No, Client doesn't work in client side, just defined it with localPlayer, well I will try what you told me, btw why this code cause lag?
  5. Hello guys, I have this part of code suggested by tosfera, but the problem is , when the player leaves the store and become in interior 0, it causes lag. and my main problem is, I want when the player leaves the store he needs to move away of store about 200meters, then a message will output. BUT, sometime it outputs this message and give player's money even he didn't pass the distance necessary. I hope you guys can give me a hand, this is so annoying, I tried all my ways but with no result. function renderDistanceCheck () if (isPedDead(client) or getElementInterior(client) > 0) then return end if ((not isPedDead(client)) and getElementInterior(client) == 0) then local px,py,pz = 1199.13, -918.07, 43.12 local x,y,z = getElementPosition(client) local dist = getDistanceBetweenPoints3D(px, py, pz, x, y, z) if (dist >= 200) then outputChatBox("Succesfully you passed 200meters away of shop") removeEventHandler ("onClientRender", root, renderDistanceCheck) end end end
  6. Hero192

    Bad argument

    But why this doesn't work? setTimer(removeEventHandler,5000,1,"onClientRender",root,dxDraw)
  7. Hero192

    Bad argument

    Can I know why this cause a warning, the warning on debug says, bad argument 3 setTimer(removeEventHandler,5000,1,"onClientRender",root,dxDraw)
  8. As the title says, how can I make a direct xDraw progress bar?
  9. Well guys, you both thanks alot for your hard works, I see how you help people and I personally appreciate that. Continue helping you're totally usefull to the community. @Bonus, sorry if I didn't explain my problem aswell, in that moment I was kinda confused. And I have no problem with how to deal with Lua, I just didn't find a way to check if the player is left an interior, I won't force him to leave from the interior. But by tosfera, my issue is fixed, thanks all. @Tosfera, special thanks to you dude, I wish all helpers to be like you, I never got an ignore by you, even sometime I was asking you alot and I felt that I was annoying but you just kept helping, that's why you are my favorit person in this community, personally I wish you to be an admin on this community and you deserve more.
  10. thanks youuu alot tosfera you're the best man , what you had sent me via pm is working
  11. Thanks alot for everything and for your time @ tosfera, you are really a good man glad to meet you here, I'll test it now and tell you the results
  12. It works but I 5old you the problem in my first post
  13. I wont force player to leave the store, i just want see if he is left to continue scripting
  14. Anyone please can give me a hand
  15. Dude sorry if i didnt explain my problem but I wont set the player his interior into 0 but i want to check if the player is out of interior. For example when the player rob a store and he left the store then give him a reward.. I hope you can undetstand what i mean
  16. Well, Basically I am doing a mission inside an "Interior", and want to find a way to check when the player is left the interior that's mean he's on interior 0. The simple check, if getElementInterior(source) then == 0 end doesn't work in my case. So, I used to do this way in below, it print a Mission Passed on the leave, I want it be printed only if the dist is >= 100 meters addEvent("removePlayerAnim",true) addEventHandler("removePlayerAnim", root, function() setPedAnimation(source) _getElementInterior(source, 0) end) function _getElementInterior(element, int) if isElement(element) and getElementType(element) == "player" and int == 0 then timer = setTimer( function() local x, y, z = getElementPosition(element) local px, py, pz = 1199.1300048828, -918.07098388672, 43.124603271484 local dist = getDistanceBetweenPoints3D(x, y, z, px, py, pz) if getElementInterior(element, int) == 0 and dist >= 100 then givePlayerMoney(element, 1000) outputChatBox("Mission Passed", element, 22,22,200) end end,1000,0) end end
  17. Are you talking about this code that you had sent to me? it set player's interior not checking it local _setElementInterior = setElementInterior function setElementInterior ( element, int ) if isElement ( element ) and getElementType ( element ) == "player" and int == 0 then -- Do whatever you want here -- end return _setElementInterior ( element, int ) end Anyone?
  18. I know it works in another way, but doesn't work because, I am doing a mission inside an interior > 0, so I have to make a timer untill the player leave the interior to continue what I wanted to do, and you know this timer cause lags .. so anyway?
  19. I won't set player interior, I want to get the interior. Normal check like that doesn't work if getElementInterior(source) == 0 then --code end
  20. Hello guys, I am scripting a mission, but i face a problem, I want to check when the player is on interior 0 I tried this way if getElementInterior(source) == 0 then -- code end But doesn't work. This way in below works but it cause lags, I want a proper way please addEvent("remove",true) addEventHandler("remove", root, function() setPedAnimation(source) getPlayerInterior(source, 0) end) local timer = nil function getPlayerInterior(player, int) timer = setTimer( function() if getElementInterior(player) == tonumber(int) then if isTimer(timer) then killTimer(timer) end end end,1000,0) end -Thanks in advance.
  21. Can I just know why I have to use getLocalPlayer() and getRootElement() in client side, I mean in which case
  22. Can I just know what's the difference between the first example and the second one? I mean if we attached root to the event and if we attached localplayer. --1st Example: function targeting ( target ) if ( target ) then --code end end addEventHandler ( "onClientPlayerTarget", getRootElement(), targeting ) --2nd Example: function targeting ( target ) if ( target ) then --code end end addEventHandler ( "onClientPlayerTarget", getLocalPlayer(), targeting )
  23. Well, you are totally right man, I did the second one it worked but it cause lags, so now I want to start with the first idea, what I have to do , I mean which functions / events I have to use?, please give me the light to follow Note: thanks dude
  24. Hello guys, I am doing a loc system which an object be over the player's head, I made it, but the problem is with the element doesn't follow the player in every interior / dimension only work in dim 0 & int 0. Can anyone tell me what I have to do?
  25. Tnx alot, but who told you it's faster than pairs & ipairs?
×
×
  • Create New...