Jump to content

Kenix

Retired Staff
  • Posts

    4,121
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Kenix

  1. Kenix

    Remote car

    createPed setElementAlpha setPedControlState bindKey
  2. https://wiki.multitheftauto.com/wiki/Meta.xml
  3. Kenix

    Horn

    function createHorn ( ) local x, y, z = getElementPosition ( player ) -- variable player not defined local vehicle = getPedOccupiedVehicle ( player ) -- variable player not defined local sound = playSound3( "newhorn.mp3" ) -- function playSound3 not exists, should be playSound3D but this function only client side setSoundVolume ( sound, 0.5 ) -- client side function, but you use in server side attachElements ( sound, vehicle ) end addCommandHandler("horn", createHorn) function onPlayerJoin() bindKey( source, "h", "both", createHorn ) end addEventHandler( "onPlayerJoin", root, onPlayerJoin ) addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function () for i,v in pairs(getElementsByType("player")) do bindKey(v,"h","both",createHorn) end end) Read comments Also tabulate your code in next time. https://wiki.multitheftauto.com/wiki/Scr ... troduction
  4. I given you manuals about it. You just not read! Ignore .. http://en.wikipedia.org/wiki/Programming_style https://forum.multitheftauto.com/viewtop ... 91&t=41066 Example Wrong function fTest( nFinal ) if type( nFinal ) == 'number' then local nCount = 0 while nCount < nFinal do nCount = nCount + 1 end return nCount end return false end print( fTest( 9 ) ) -- 9 Correct function fTest( nFinal ) if type( nFinal ) == 'number' then local nCount = 0 while nCount < nFinal do nCount = nCount + 1 end return nCount end return false end print( fTest( 9 ) ) -- 9 You got it? Variable zombieKills not defined.
  5. I said about tabulation. Can you hear me? Also you not written what's wrong.
  6. Kenix

    XML problem :$

    I mean check returned value. https://wiki.multitheftauto.com/wiki/OutputChatBox https://wiki.multitheftauto.com/wiki/OutputDebugString .. I think your script not working, because you not add lines to meta.xml or script have syntax errors. File new.xml should created. Also function xmlCreateFile have only 2 arguments. Why you use 3? And can you tabulate your code? Founded http://gmc.yoyogames.com/index.php?showtopic=511359
  7. math.floor math.ceil http://lua-users.org/wiki/MathLibraryTutorial
  8. Kenix

    text

    dxDrawText getScreenFromWorldPosition
  9. Omg .. Can you learn lua?
  10. AMARANT, Report in bug tracker.
  11. I tested it. All working perfectly .. https://nightly.multitheftauto.com/
  12. Example local nWidth, nHeight = guiGetScreenSize( ) local sImage = 'image.png' local tDownloadFiles = { 'car.txd'; 'car.dff'; -- ... } local fDraw = function( ) dxDrawImage( 0.5 * nWidth, 0.5 * nHeight, 0.5 * nWidth, 0.5 * nHeight, sImage ) end addEventHandler( 'onClientFileDownloadComplete', root, function( sFile, bSucces ) if sFile == sImage and bSucces then addEventHandler( 'onClientRender', root, fDraw ) for _, s in ipairs( tDownloadFiles ) do downloadFile( s ) end elseif sFile == tDownloadFiles[1] then local uTxd = engineLoadTXD ( sFile ) engineImportTXD ( uTxd, 587 ) elseif sFile == tDownloadFiles[2] then local uDff = engineLoadDFF ( sFile, 587 ) engineReplaceModel ( uDff, 587 ) end end ) addEventHandler( 'onClientResourceStart', resourceRoot, function( ) downloadFile( sImage ) end ) meta.xml <meta> <script src='c.lua' type='client' /> <file src='image.png' download='false' /> <file src='car.txd' download='false' /> <file src='car.dff' download='false' /> </meta> downloadFile Who want test it http://www.getzilla.net/files/3280297/testing.rar.html http://depositfiles.com/files/v2yqqj3ag Updated
  13. Khtsjefen, All what you write is wrong.. I written better solution.
  14. Kenix

    Find edit

    Can you show full code?
  15. Kenix

    dxscoreboard

    yanvr Use [xml][/xml] tags in next time.
  16. Solidsnake14, Link this topic, if someone need lua tutorials.. viewtopic.php?f=148&t=40809
  17. First download image. When image is downloaded draw it and download all next files. https://wiki.multitheftauto.com/wiki/DownloadFile https://wiki.multitheftauto.com/wiki/OnC ... adComplete
  18. He need use only ( for delete table ) local uConnection = dbConnect( -- arguments here ) -- connect to db dbExec ( uConnection, "DROP TABLE `testtable`" ) -- request destroyElement( uConnection ) -- close connection
×
×
  • Create New...