Jump to content

JR10

Retired Staff
  • Posts

    2,947
  • Joined

  • Last visited

Everything posted by JR10

  1. function moveThePlayer() local playerexp = getElementData(source, "Exp") if not playerexp then setElementData(source, "Exp", 0) playerexp = 0 end if (playerexp) <= 500 then setElementData(source, "JOB", "POLICININKAS") setElementModel(source, 280) outputChatBox ( "Sveikiname jus nuo siol esate pareigunas. Dirbkite atsakingai!", source) else outputChatBox ( "Jus neturite pakankamai patirties!", source) end end -- define our custom event, and allow it to be triggered from the client ('true') addEvent("giveJob",true) -- add an event handler so that when movePlayerToPosition is triggered, the function moveThePlayer is called addEventHandler("giveJob",root,moveThePlayer)
  2. What do you mean? Perhaps this: getTickCount
  3. function yakuza(thePlayer) local account = getPlayerAccount ( thePlayer ) if not isGuestAccount(account) and getAccountName(account) == "yakuza" then respawnVehicle ( vehicle1 ) else outputChatBox ( "You cant make this use", thePlayer, 255, 200, 0 ) end end addCommandHandler("respawnmycar", yakuza) Is vehicle1 a global variable?
  4. JR10

    [TUT] SQLite

    That's up to you, you should pick something easy to practise with.
  5. DarkLink lol, check the date before posting man. And only admins can create houses.
  6. اهلا بيك الموضوع صعب فى الأول, لكن باذن الله يبقى أسهل بالمحاولة أنصحك بالويكى كبداية, و استفسر هنا https://wiki.multitheftauto.com/wiki/Main_Page
  7. How can you have an mp3 file in a map? Anyway, since it's in the meta as a file, it will be downloaded.
  8. JR10

    fix water

    Already reported..
  9. That's not a problem or a bug, the client sided scripts and client files are downloaded and saved. The maps are downloaded, but not saved, so the client will download it over and over again. You can't compile a map file, so with what you want, everyone will download the maps and use them personally.
  10. JR10

    /me command

    addEventHandler('onPlayerChat', getRootElement(), function(message, messageType) if (messageType == 1) then cancelEvent() end end) function meCommand(player, cmd, ...) local wordsTable = {...} local msg = table.concat(wordsTable, " ") if msg and #wordsTable > 0 then local posX, posY, posZ = getElementPosition(player) for index , _player in pairs ( getElementsByType ( "player" ) ) do if isPlayerInRangeOfPoint ( _player , posX , posY , posZ , 20 ) then outputChatBox('* ' .. getPlayerName(player) .. ' ' .. msg, _player, 194, 162, 218) end end else outputChatBox('NAUDOJIMAS: /me [tekstas]', player, 255, 255, 255) end end addCommandHandler('me', meCommand) function isPlayerInRangeOfPoint ( player , posX , posY , posZ , range ) local _posX , _posY , _posZ = getElementPosition ( player ) return ( ( posX - _posX ) ^ 2 + ( posY - _posY ) ^ 2 + ( posZ - _posZ ) ^ 2 ) ^ 0.5 <= range end
  11. JR10

    /me command

    Try this: addEventHandler('onPlayerChat', getRootElement(), function(message, messageType) if (messageType == 1) then cancelEvent() end end) function meCommand(player, cmd, ...) local msg = table.concat({...}, " ") if msg and #{...} > 0 then local posX, posY, posZ = getElementPosition(player) for index , _player in pairs ( getElementsByType ( "player" ) ) do if isPlayerInRangeOfPoint ( _player , posX , posY , posZ , 20 ) then outputChatBox('* ' .. getPlayerName(player) .. ' ' .. msg, _player, 194, 162, 218) end end else outputChatBox('NAUDOJIMAS: /me [tekstas]', player, 255, 255, 255) end end addCommandHandler('me', meCommand) function isPlayerInRangeOfPoint ( player , posX , posY , posZ , range ) local _posX , _posY , _posZ = getElementPosition ( player ) return ( ( posX - _posX ) ^ 2 + ( posY - _posY ) ^ 2 + ( posZ - _posZ ) ^ 2 ) ^ 0.5 <= range end
  12. JR10

    /me command

    addEventHandler('onPlayerChat', getRootElement(), function(message, messageType) if (messageType == 1) then cancelEvent() end end) function meCommand(player, cmd, ...) local msg = table.concat({...}, " ") if msg then local posX, posY, posZ = getElementPosition(player) for index , _player in pairs ( getElementsByType ( "player" ) ) do if isPlayerInRangeOfPoint ( _player , posX , posY , posZ , 20 ) then outputChatBox('* ' .. getPlayerName(player) .. ' ' .. msg, _player, 194, 162, 218) end end else outputChatBox('NAUDOJIMAS: /me [tekstas]', player, 255, 255, 255) end end addCommandHandler('me', meCommand) function isPlayerInRangeOfPoint ( player , posX , posY , posZ , range ) local _posX , _posY , _posZ = getElementPosition ( player ) return ( ( posX - _posX ) ^ 2 + ( posY - _posY ) ^ 2 + ( posZ - _posZ ) ^ 2 ) ^ 0.5 <= range end
  13. Why the hurry, learn first then start making scripts.
  14. And 'source' shouldn't be in the function arguments. And fileDelete thing for client sided scripts doesn't work, I tried it, if you disconnect, it will remain.
  15. Nice tutorial. White is a bad choice for a color. I think you got it wrong, this is for compiling MTA:SA from source. Not for compiling Lua scripts.
  16. JR10

    [TUT] SQLite

    I've never used MySQL, perhaps I will learn it soon and post a tut.
  17. What does it say in debugscript?
  18. Dude, you need to use guiSetText correctly, and many times to change each GUI element's text to Arabic. See guiSetText wiki page.
  19. Does the drift resource have an exported function so you can get the drift?
  20. He already copied that script and edited the name of the column. You need to edit the scoreboard resource, so it draws image instead of text.
  21. function findRotation ( posX , posY , _posX , _posY ) return 360 - ( math.deg ( math.atan2 ( _posX - posX , _posY - posY ) ) % 360 ) end Will get you the rotation to x,y,z addEventHandler("onClientClick", getRootElement(), function( button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement ) if(button == "left")then if(state == "down")then local x, y, z = worldX, worldY, worldZ if x and y and z then local posx , posy , posz = getElementPosition ( localPlayer ) local rot = findRotation ( posx , posy , x , y ) setPedRotation ( localPlayer , rot ) setControlState ( "forwards" , true ) end end end end) function findRotation ( startx , starty , endx , endy ) return 360 - ( math.deg ( math.atan2 ( endx - startx , endy - starty ) ) % 360 ) end Now you need to work something out for stopping him when he arrive. And prevent him from stopping due to obstacles.
×
×
  • Create New...