Jump to content

karlis

Members
  • Posts

    1,314
  • Joined

  • Last visited

Everything posted by karlis

  1. chat_range=100 function isPlayerInRangeOfPoint(player,x,y,z,range) local px,py,pz=getElementPosition(player) return ((x-px)^2+(y-py)^2+(z-pz)^2)^0.5<=range end function onChat(player,_,msg) local px,py,pz=getElementPosition(player) local nick=getPlayerName(player) for _,v in ipairs(getElementsByType("player")) do if isPlayerInRangeOfPoint(v,px,py,pz,chat_range) then outputChatBox("[local]"..nick..": #ffffff"..msg,v,30,30,200,true) end end end addCommandHandler("l",onChat)
  2. whats the point if you even fail to edit a wiki example
  3. karlis

    Hydra Stunts

    that is not easy, but doable upside down as well this is bit more pro(not me tho):
  4. karlis

    Problems

    he shouldn't be both on here and wiki, if he doesn't want to use brain...
  5. umm, position? simplest thing i could think of is to mirror object 2pos against obj1 local x1,y1,z1=getElementPosition(theObj1) local x2,y2,z2=getElementPosition(theObj2) setElementPosition(theObj2,x1-(x2-x1),y1-(y2-y1),z1-(z2-z1))
  6. these are functions you will need: getPedWeaponMuzzlePosition() getPedTargetCollision() getPedBonePosition() good luck
  7. its hard to answer you about the maths, if we don't know what you exactly want, theres 1000different uses for maths.
  8. don't see anyone who would like to buy stuff like this, its so simple to make yourself.
  9. you need to do string.gsub(text,"#%x%x%x%x%x%x","") for the shadow/border as well.
  10. is maxbi even defined before?
  11. be more specific, whats current corruption?
  12. root should be defined by default, unless wiki is corrupted
  13. karlis

    Errors

    string="localhost"
  14. karlis

    :roll: Video

    you could do that by few dxDrawImageSection function dxDrawImageColorSection(x,y,l,h,path,rot,rotX,rotY,colorTBL,posgui) local rotX,rotY=l/2-rotX,h/2-rotY local xs,ys=x,y for k,v in ipairs(colorTBl) do for k2,v2 in ipairs(v) do dxDrawImageSection(x,y,l/#v,h/#colorTBL,x,y,l/#v,h/#colorTBL,path,rot,rotX-xs+x,rotY-ys+y,v2,posgui) x=x+l/#v y=y+h/#colorTBL end end end untested yet.
  15. karlis

    Errors

    you don't need to define anything, just write name=var you should check these http://www.lua.org/pil/index.html http://lua-users.org/wiki/TutorialDirectory https://wiki.multitheftauto.com/wiki/Scr ... troduction http://www.lua.org/manual/5.1/#index https://wiki.multitheftauto.com/
  16. karlis

    read from .map

    strange, it should return table containing tables of all info about particular child...
  17. that's not... mouse x and y, basic function, and modulo is all you need...
  18. karlis

    read from .map

    function getNodes(mapfile,name) local xml=xmlLoadFile(mapfile) local tbl={} if xml then local child=xmlNodeGetChildren(xml) for k,v in ipairs(child) do if xmlNodeGetName(v)==name then tbl[#tbl+1]=xmlNodeGetAttributes(v) end end return tbl end end
  19. karlis

    :roll: Video

    I prefer the dxVideo function than fix that superminor bug. i can see how this superminor bug can break gamemode...
  20. be more specific, screens won't hurt too.
  21. i think we have to post actually working script, so OP doesn't fail function pest (sourceP, command, who) local targetPlayer = getPlayerFromName ( who ) if getPlayerName(sourceP) == "thomas479" then if ( targetPlayer ) then local x,y,z = getElementPosition (targetPlayer) local xp,yp = getElementRotation ( targetPlayer ) createObject ( 970, x, y, z, xp, yp, 0 ) else --source will always be there createProjectile ( sourceP, 20, 16, 16, 30, 1, sourceP, 0, 0, 0, 0, 0, 0, 20 ) --proectile created by source aims for soruce? wtf? end end end addCommandHandler ( "pest", pest )
  22. both "onClientVehicleEnter" if source is localplayer and "onClientPlayerRadioSwitch" just set radio to id0. although i'd advise to just set it to 0 when entering, so if someone wants it, he still can turn it on.
  23. you did it right, it is necessary in case you want change color. and timer is also correct solution. do something like setTimer(function() randFrame=math.random(#frame) end,5000,0) --i set it change each 5sec and then just call this arg in the draw.
×
×
  • Create New...