Jump to content

karlis

Members
  • Posts

    1,314
  • Joined

  • Last visited

Everything posted by karlis

  1. karlis

    Anti_Hack Help

    its getPedOcuppiedVehicle, not GetPedOcuppiedVehicle
  2. https://community.multitheftauto.com/ind ... ils&id=632 this resource handles it all by commands its a bit messy because i made it when i just learned scripting, but it still works(at least for me)
  3. karlis

    onClientKey

    you could just bind all keys to particular function. binds= { "A", } --fill this with all key names localP=getLocalPlayer() addEvent("onClientKey",false) function bindEventHandler(key,state) triggerEvent("onClientKey",localP,key,state) end for k,v in pairs(binds) do bindKey (v,"both",bindEventHandler) end
  4. i meanth gradient by recoloring, currently it would take hell of lag to draw one. and yes round section would be nice.
  5. addEventHandler('onClientResourceStart', getResourceRootElement(), function() txd = engineLoadTXD ( "data/infernus.txd" ) engineImportTXD ( txd, 411 ) dff = engineLoadDFF ( "data/infernus.dff", 411 ) engineReplaceModel ( dff, 411 ) end ) corrected resource root, as it wasn't defined in your snippet
  6. karlis

    Anti_Hack Help

    yep true, soz didnt script a while and forgot the proper names.
  7. karlis

    Gm image

    its funny, how hard it might get to explain this easy stuff...
  8. karlis

    Anti_Hack Help

    might be better to store player variable, then to get player 5times. also theVehicle pos will never be set, as player is not false/nil always. and it currently has no way of removing the timer, you should add. addCommandHandler("doesnthack",function(_,_,name) killTimer(timers[getPlayerFromName(name)]) end)
  9. doh, sorry for that
  10. karlis

    Gm image

    get() doesnt work clientside
  11. karlis

    Gm image

    i gave clientside part with need to be adjusted with right args, and instructions what to change in your server side part.
  12. karlis

    Anti_Hack Help

    yes, basically it just destroys car is there is one.
  13. karlis

    Gm image

    first, it have to be clientside. second, it makes no sence how you put it together. third, im helping you, but not going to make whole resource. and yes, it draws off or on, depending on state of that element data.
  14. karlis

    Gm image

    replace first 4arguments with position/size of image you need, according to wiki,(im my example image is created 100pixels from bottom right corner in both directions, and is 80pixel high and long) and then put those 2 filepaths at the end for example if gmoff image is called "GMoff.png", then put the image in same folder as this script, and write "GMoff.png" in the filepath string x,y=guiGetScreenSize() localP=getLocalPlayer() addEventHandler("onClientRender",getRootElement(),function() dxDrawImage (x-100,y-100,80,80,getElementData(localP,"overrideCollide.uniqueblah") and "GMon.png" or "GMoff.png") end)
  15. karlis

    Anti_Hack Help

    acutally i have no idea what you wanted to to with the loop, so sorry if this doest solve your problem function hacker(player,commandName, name,) local theVehicle = getPedOccupiedVehicle (player) if theVehicle then destroyElement(theVehicle) end setElementPosition(player, 0, 0, 3) outputChatBox("TURN OFF OR REMOVE THE HACK!",player,255,0,0) end addCommandHandler("hack",hacker)
  16. karlis

    Gm image

    what you don't understand?
  17. randID and randomID isn't the same. also make sure filepaths are right. and you forgot to add handler. afaik setting sound loudness to 1.0 is not needed, it should be default, but not sure.if it fails, try setting it to 1.0 manually. but 1function less called is always nice. sounds = { "back.wav", "death.wav", "pisses.wav" } addEventHandler("onClientPlayerWasted",getLocalPlayer(), function() playSound(sounds[math.random(1,#sounds)]) end)
  18. karlis

    Gm image

    1)sync the element data with clients, by changing last false to true in line 17 & 23 2)add in client script x,y=guiGetScreenSize() localP=getLocalPlayer() addEventHandler("onClientRender",getRootElement(),function() dxDrawImage (x-100,y-100,80,80,getElementData(localP,"overrideCollide.uniqueblah") and "on filepath" or "off filepath") --adjust height etc, dunno them, and put real image filepaths; this "isTrue and doIfTrue or doIfFalse" is short way of duing "if .. then x=a else x=b end". end)
  19. you don't need to create it, https://wiki.multitheftauto.com/wiki/Resource:Interiors https://community.multitheftauto.com/ind ... ils&id=436
  20. check this thread viewtopic.php?f=91&t=33125 they're not perfect indeed, but a nice start.
  21. is it the right obj, and did you fix the arguments? also vehicle argument was incorrect. pay more attention on typos. addEvent("premiumbuysmoke", true) addEventHandler("premiumbuysmoke", getRootElement(), function() if isPedInVehicle(source) then local x, y, z = getElementPosition( source ) local car = getPedOccupiedVehicle( source ) local ramp = createObject ( 2780, 0, 0, 0, 0, 0, 0 ) attachElements ( ramp, car, 0, -5.255, 0, 0, 45, 118 ) outputChatBox("*Premium: "..getPlayerName(source).." Ur Car Got Smoked!",getRootElement(),0,255,0) end end)
  22. you have typo in line2, its "premiumbuysmoke". not "preiumbuysmoke" also delete line 5, no use for it. EDIT: your params for attach is incorrect, theres a boolean where rotZ should be, and 2 more params with no use. EDIT2: also createObject requires no booleans, but 1more rotation value.
  23. afaik theres no way of deleting it, but i might be wrong.
  24. so is this, and my post also.
×
×
  • Create New...