Jump to content

lolman

Members
  • Posts

    70
  • Joined

  • Last visited

Everything posted by lolman

  1. Thought about : removeCommandHandler ?
  2. Hello, I've been facing a problem with my code. It's ment to prevent weaponhit when a player has an elementData called : antiSpam. That works, I get an elementData but it doesn't prevent the damage... I know that the elementData works because I've tested on outputChatBox ... Here's the code : function getAntiSpam() local getAnti = getElementData(getLocalPlayer(), "antiSpam") if (getAnti == 1) then outputChatBox("works...", 255, 0, 0) cancelEvent() end end addEventHandler("onClientPlayerWeaponFire", root, getAntiSpam) function setAntiSpam() setElementData(getLocalPlayer(), "antiSpam", 1) end addEventHandler("onClientResourceStart", root, setAntiSpam) addEvent("SetANTI", true) addEventHandler("SetANTI", root, setAntiSpam) function setAntiSpamOnExplosive(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement) if weapon == 16 then triggerEvent("SetANTI", getLocalPlayer()) end end addEventHandler("onClientPlayerWeaponFire", root, setAntiSpamOnExplosive)
  3. Hmm, I had changed that line where it says : setElementData(getLocalPlayer(), "Fuel", (getFuel-1.000)) to setElementData(getPedOccupiedVehicle(getLocalPlayer()), "Fuel", (getFuel-1.000)) but the text (fuel) doesnt even gets lower... sorry for what I've said above but I don't see any errors and it doesn't work...
  4. doesnt work... if i get in a vehicle and the fuel is empty and then get in an another one there comes a lot of bug in the debugmessages...
  5. Hello, I've been working on the fuel system but the problem is that I don't know what to do... I mean, the fuel system works perfect but because I did getLocalPlayer() the player which one's fuel is 0% and gets in an another vehicle it also says 0%... I tried looping but that doesn't work also.. If someone could explain me a bit... Here's the code: local x, y = guiGetScreenSize() function drawFuel() local theVehicle = getPedOccupiedVehicle(getLocalPlayer()) local getFuel = getElementData(getLocalPlayer(), "Fuel") if isPedInVehicle (localPlayer) == false then return end sx, sy, sz = getElementVelocity (theVehicle) kmhs = math.floor(((sx^2 + sy^2 + sz^2)^(0.5))*180) dxDrawText ( ""..math.round(getFuel, 2).." %", 44, y - 41, x, y, tocolor ( 0, 0, 0, 255 ), 1.02, "bankgothic" ) if getKeyState("W") or getKeyState("S") then setElementData(getLocalPlayer(), "Fuel", (getFuel-1.000)) end end function HandleTheRendering ( ) addEventHandler ( "onClientRender", root, drawFuel ) end addEventHandler ( "onClientResourceStart", resourceRoot, HandleTheRendering ) function outOfFuel() local getFuel = getElementData(getLocalPlayer(), "Fuel") local theVehicle = getPedOccupiedVehicle(getLocalPlayer()) if isPedInVehicle(localPlayer) == false then return end if (getFuel < 0) then dxDrawText ( "0 %", 44, y - 41, x, y, tocolor ( 0, 0, 0, 255 ), 1.02, "bankgothic" ) setVehicleEngineState(theVehicle, false) removeEventHandler("onClientRender", root, drawFuel) end end function setFuel() setElementData(getLocalPlayer(), "Fuel", 100) end addEventHandler("onClientResourceStart", root, setFuel) function HandleTheRendering2 ( ) addEventHandler ( "onClientRender", root, outOfFuel ) end addEventHandler ( "onClientResourceStart", resourceRoot, HandleTheRendering2 )
  6. Still doesn't work... see the debugs ...
  7. Hello, Since I'm using this function : getTimerDetails() I see messages on debugconsole everytime the timer is false... at the function it says that I can prevent it by using the function isTimer() but I've used all methods (almost) but nothing ... This is my code : theTimer = setTimer(function() end, 2000, 1) function timerDetails() remaining = ( getTimerDetails(theTimer) /1000 ) if (remaining) then if isTimer(theTimer) then dxDrawText("Time : "..remaining, 574, 543, 790, 590, tocolor(255, 187, 23, 255), 1.50, "bankgothic", "left", "top", false, false, false, false, false) else return end end end addEventHandler("onClientRender", root, timerDetails) If someone could help me to prevent this debug message I'd be glad!
  8. Youre welcome. About the signals, maybe you could attach small markers on every side of a vehicle and when you press a button the markers on a purposed side show up (have seen this idea on an another server) but the choice is up to you...
  9. This function : createMarker Has already an argument which contains the alpha of the marker with the letter : a. About signals, you can take a look at community.multitheftauto.com and search there and take a look into the code how it's done
  10. I fixed it by my self (so quickly) but thanks for the fast reply
  11. Hello, I want to setTimers on dxDrawText because I want to make a conversation script (animation with just some text shown). I tried to do it but I can only see the text but it doesnt get removed... local x, y = guiGetScreenSize() function togglePanel() dxDrawRectangle(x*0, y*0, x*1, y*0.17, tocolor(0, 0, 0, 255), true) dxDrawRectangle(x*0, y*0.83, x*1, y*0.17, tocolor(0, 0, 0, 255), false) setTimer(tekst1, 1500, 1) end function drawPanel() addEventHandler("onClientPreRender", root, togglePanel) end addEvent("drawPanel", true) addEventHandler("drawPanel", getRootElement(), drawPanel) function hidepanel() removeEventHandler("onClientPreRender", root, togglePanel) end addEvent("hidepanel", true) addEventHandler("hidepanel", getRootElement(), hidepanel) function tekst1() dxDrawText("Test", x*0.67, y*0.8, x*0.38, y*0.05, tocolor(255, 255, 255, 255), 2, "default", "center", "center", false, false, true, false, false) end As you can see in this script, there is a setTimer function but it only shows the text after that time but I want it also to remove it with timer...
  12. Doesn't matter, it still works (tested it more then 100000 times and still works by using > instead of >=)
  13. find the line where it says : bindKey(blablabla) then just paste it and add a new line. But the "N" should be replaced by "," or "." what you want
  14. dxDrawText(""..cash, sX*0.87, sY*0.11, sX*0.2, sY*0.2, tocolor(195, 195, 195, 255), sY/768,1, "pricedown", "left", "top", false, false, false, false, false) This must be this (if im right...): dxDrawText(..cash, sX*0.87, sY*0.11, sX*0.2, sY*0.2, tocolor(195, 195, 195, 255), sY/768,1, "pricedown", "left", "top", false, false, false, false, false) But have you defined cash? if not then ofc it will not work...
  15. If nothing helps, then just make a function in server side and then do triggerServerEvent, simple as that...
  16. Can you explain me this XML thing? I want to save it on that. I don't have any experience with XML. And can you help me a little bit on that part when I've accidentally placed a marker and I enter that marker and I do /deletemarker so I deletes the marker and removes it from the XML file?
  17. Hello, I've made an in-game marker adder but when I restart the source, all the markers are gone which I made. If someone could help me out? policee = {} function policeMarker(thePlayer, commandName) accountname = getAccountName (getPlayerAccount(thePlayer)) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then local x, y, z = getElementPosition(thePlayer) police = createMarker(x+2, y, z-1, "cylinder", 1.5, 0, 0, 255) if (police) then table.insert(policee, markerPolice) outputChatBox("Marker for the team 'Police' has been created!", thePlayer, 0, 255, 0) else outputChatBox("Creating marker failed.", thePlayer, 255, 0, 0) end end end addCommandHandler("cmp", policeMarker)
  18. Ye, I had the same problem once, wtf is the problem and how to solve this??
  19. Whats webUI? the webbrowser script from MTA itself or...? because I only downloaded a client side and a meta...
  20. Lmaoo didnt even know that there was a function called with that name. Because of you, i've learned something new today ! Thank you
  21. I think that making onClientPlayerDamage would he better...
  22. Admins cant see their IP If youre an admin (in the acl admin) then you can see other ppls IP other people can't see anyones IP even their own IP not
  23. one word : WOW... Dude you're amazing as always again !! thank you very much ! But how can I lock this on admin. I want it like if you are in the acl group admin (for i, player in ipairs(getElementsByType("player")) do accountname = getAccountName (getPlayerAccount(player)) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "admin" ) ) then) then you're able to see the IP of the person and other people can't see their IP's nor from other people.
×
×
  • Create New...