Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Store the tick count from when you last visted somewhere, then make a math to calculate how long it passed since last visit.
  2. You can try with getTickCount
  3. I don't really understand what ur doing there, is this your whole code?
  4. Castillo

    Sniper bullets

    -- client side: addEventHandler ( "onClientPlayerWeaponFire", localPlayer, function ( weapon, _, _, _, _, _, hitElement ) if ( weapon == 34 ) then if ( isElement ( hitElement ) and getElementType ( hitElement ) == "vehicle" ) then blowVehicle ( hitElement ) end end end )
  5. Well, I actually think that when you give an "example" as you say, it should do what he wanted, else, he'll later think that he has to use variables and not tables, so is an incomplete example.
  6. if not LastHandled [ thePlayer ] then LastHandled [ thePlayer ] = { } end You made that, but it'll always clean the table again, because 'false' and 'nil' will pass that 'if'.
  7. Won't work either. This one works: local LastHandled = { } function buyhealth ( thePlayer ) if ( LastHandled [ thePlayer ] == nil ) then LastHandled [ thePlayer ] = { } end if ( LastHandled [ thePlayer ] == false ) then return outputChatBox ( 'Please Wait 20 Sec!', thePlayer, 255, 0, 0 ) end local money = getPlayerMoney ( thePlayer ) if ( money >= 500 ) then outputChatBox ( "Você comprou Vida por 500$", thePlayer, 255, 106, 106 ) local thePlayerhealth = getElementHealth ( thePlayer ) setElementHealth ( thePlayer, 569 ) takePlayerMoney ( thePlayer, 500 ) else outputChatBox ( "Não há dinheiro suficiente, necessário 500$", thePlayer, 139, 101, 8 ) end LastHandled [ thePlayer ] = false setTimer ( function ( ) LastHandled [ thePlayer ] = true end ,20000, 1 ) end addCommandHandler ( "vida", buyhealth )
  8. Where is the table "LastHandled" defined?
  9. Copiaste el script mal.
  10. It should be, but since trains aren't synced, you'll have to do some tricks I think.
  11. Se llama "trials" y aca esta el link: https://community.multitheftauto.com/in ... ils&id=430
  12. local skins = { { fileName = "riotpolice", skinID = 2 }, { fileName = "wmymech", skinID = 3 }, } function load ( ) for _, skin in ipairs ( skins ) do txd = engineLoadTXD ( skin.fileName .. ".txd" ) engineImportTXD ( txd, skin.skinID ) dff = engineLoadDFF ( skin.fileName .. ".dff", 0 ) engineReplaceModel ( dff, skin.skinID ) end end addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) setTimer ( load, 1000, 1 ) end )
  13. This will make it a global variable, meaning that if another player says "lol", it'll increase the variable. He should use a table instead.
  14. We don't accept requests here, and if you already come by "I don't even want to learn", well, you're in the wrong forum then.
  15. We don't give support with leaked scripts. Topic locked.
  16. No, creas un nuevo recurso, le creas un meta.xml y definis ese script como server side.
  17. No damos ayuda con scripts filtrados e ilegales ( valhalla ). Tema cerrado.
  18. addEventHandler ( "onResourceStart", resourceRoot, function ( ) exports [ "scoreboard" ]:scoreboardAddColumn ( "level" ) end ) Pone eso en un script server side.
  19. Yeah, get the position of 'source'.
  20. You can't set the property just for one player, it's only global.
  21. Are you sure that you changed it and saved?
×
×
  • Create New...