Jump to content

xXMADEXx

Members
  • Posts

    2,718
  • Joined

  • Last visited

Everything posted by xXMADEXx

  1. I guess scenes your OCD with LUA (just like me) this code will help you. teams = { {"Freeroam Arena", 0, 255, 0 }, {"Stuntage Arena", 220, 220, 0}, {"Deathmatch Arena", 0, 220, 220}, {"Drift Arena", 50, 0, 220}, {"DayZ Arena", 255, 0, 0}, {"Lobby", 255, 255, 255} } team = { } for i, v in ipairs ( teams ) do team [ i ] = createTeam ( v [ 1 ], v [ 2 ], v [ 3 ], v [ 4 ] ) end function setTheyreTeam ( who, team ) local team = getTeamFromName ( team ) if ( team ) then setPlayerTeam ( who, team ) end end
  2. xXMADEXx

    3D text

    6 is just the max distance you can see it... Its something do do with "local x, y, z = getElementPosition ( localPlayer )'
  3. xXMADEXx

    3D text

    Hi guys, im making staff texts, but i get some gay error. When i am moving ( Running, walking, jumping, etc..) it spams debugscript. But, if im standing still, it works perfect Screen: http://imageshack.us/a/img14/9074/mtasc ... 210724.png Code: function dxNameTags ( ) for i, v in ipairs ( getElementsByType ( "player" ) ) do if ( v ~= localPlayer ) then local job = getElementData ( v, "Job" ) if ( job == "New Staff" or job == "Trained Staff" or job == "Trusted Staff" or job == "High Staff" or job == "Full Staff" ) then local x, y, z = getElementPosition ( localPlayer ) local x2, y2, z2 = getElementPosition ( v ) if ( type( x ) == "number" and type ( y ) == "number" and type ( z ) == "number" ) then if ( type ( x2 ) == "number" and type ( y2 ) == "number" and type ( z2 ) == "number" ) then local dist = getDistanceBetweenPoints3D ( x, y, z, x2, y2, z2 ) local defdd = 6 if ( dist < 6 ) then local scx, scy = getScreenFromWorldPosition ( x2, y2, z2 + 1 ) if isLineOfSightClear ( x, y, z, x2, y2, z2, true, false, false, false ) then local scale = 2 * ( ( defdd - dist ) / defdd ) local level = getElementData ( v, "Job" ) exports["SRNJobs"]:dxDrawBorderedText( level, scx, scy, scx, scy, tocolor ( 255, 255, 0, 255 ), scale, "default-bold", "center", "center", false, false, false ) end end end end end end end end
  4. I think that GTA SP is on a random weather system, but if you wanted to make random weather i guess you could use setTimer or create a table with differant weather settings...
  5. vehicle = createVehicle( data.model, unpack( v ) ) setTimer( function ( ) setElementFrozen ( vehicle, true ) end, 15000, 0)
  6. Post the meta.xml, MTA:SE could have had an error creating the file or something.
  7. I think you're talking about what ITYAMA said, and setTimer
  8. Its server side, obviously... bool triggerClientEvent ( [element sendTo=getRootElement()], string name, element theElement, [arguments...] ) Example: triggerClientEvent ( root, "theClientSideEvent", root )
  9. function MilitarySpawn( ) local thePlayer = source spawnPlayer( thePlayer, 2314.75+math.random(-1,1), -6.43+math.random(-1,1), 26.74, 180, 285, 0, 0, Military) fadeCamera( thePlayer, true) setCameraTarget( thePlayer, source) end
  10. Okey... I tried doing what you said with the camera, and I got this: addEventHandler ( "onClientRender", root, function ( ) for i, v in ipairs ( drawData ) do local text, element, r, g, b = unpack ( drawData [ i ] ) local x, y, z = getElementPosition ( localPlayer ) local tX, tY, tZ, lx, ly, lz, _, _ = getCameraMatrix( ) local dist = getDistanceBetweenPoints3D ( x, y, z, tX, tY, tZ ) local defdd = 5 if ( dist < defdd ) then local scx, scy = getScreenFromWorldPosition ( tX, tY, tZ ) if ( isLineOfSightClear ( x, y, z, tX, tY, tZ ) ) then local scale = 2 * ( ( defdd - dist ) / defdd ) dxDrawText ( text, scx, scy, scx, scy, tocolor ( r, g, b, 255 ), scale, "default-bold", "center", "center", false, false, false ) end end end end ) but for some reason "scx" is returning a boolean.
  11. Hello guys, i've created my this script, but i have one problem. When im flying in superman, i can see the text ( Which is what i want) but, when im on the ground, my name will go away.... Heres what i mean: http://imageshack.us/a/img405/7652/mtas ... 232608.png http://imageshack.us/photo/my-images/23 ... 32605.png/ Code: drawData = { } function createHeadText ( text, element, r, g, b ) if ( text and element and r and g and b ) then table.insert ( drawData, { text, element, r, g, b } ) end end addCommandHandler ( "track", function ( cmd, who ) createHeadText ( who, getPlayerFromName ( who ), 255, 0, 255 ) end ) ------------------ -- According to this, it says it sould be loading ------------------ addCommandHandler ( "viewtb", function ( ) local amount = tonumber ( #drawData ) outputChatBox ( tostring ( amount ) ) if ( amount > 0 ) then for i, v in ipairs ( drawData ) do local text, element, r, g, b = unpack ( drawData [ i ] ) outputChatBox ( tostring ( i )..": Text: "..text, r, g, b ) end end end ) addEventHandler ( "onClientRender", root, function ( ) for i, v in ipairs ( drawData ) do local text, element, r, g, b = unpack ( drawData [ i ] ) local x, y, z = getElementPosition ( localPlayer ) local tX, tY, tZ = getElementPosition ( element ) local dist = getDistanceBetweenPoints3D ( x, y, z, tX, tY, tZ ) local defdd = 5 -- Note: I have attempted changing this, but didn't do anything if ( dist < defdd ) then local scx, scy = getScreenFromWorldPosition ( tX, tY, tZ + 1) if ( isLineOfSightClear ( x, y, z, tX, tY, tZ ) ) then local scale = 2 * ( ( defdd - dist ) / defdd ) dxDrawText ( text, scx, scy, scx, scy, tocolor ( r, g, b, 255 ), scale, "default-bold", "center", "center", false, false, false ) end end end end )
  12. We don't make scripts for you... Try to make it, and we help.
  13. use exports and/or triggerEvent/triggerServerEvent/triggerClientEvent...
  14. Yes Well, what are they?
  15. I started mysql and my script but not working. errors?
  16. Hello guys, im making a vending script, but i need a little help restoring the animation.... For some reason, after the animation is done, the players arm will stay up, until he enters a vehicle (or does another animation,) i tried, but i cannot figure out how to reset his animation to default ( I have used "setPedAnimation ( source )" ) Code: setPedAnimation ( source, "VENDING", "VEND_Drink2_P", 1000, false )
  17. Show your code, on how your loading...
  18. This page isn't for advertising... Its for scripting help.
  19. Not all scripts can be done in a single day.
  20. You have to make them yourself. or pay someone to make it
  21. xXMADEXx

    GUI Bug.

    i think you messed up on the function part... use: function (user, pass) -- (Not sure how your client side works)
×
×
  • Create New...