Jump to content

manawydan

Members
  • Posts

    980
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by manawydan

  1. manawydan

    Trem help

    how to put the "wagon" train on the train? (train Freight,Flat Freight) thanks
  2. only example function meCom (Mens,typ) if typ == 1 then local PlayersP = getElementsByType("player")) for _,Pl in ipairs(PlayersP) do local x,y,z = getElementPosition(Pl) local x2,y2,z2 = getElementPosition(source) -- source of the event "onPlayerChat" local Distance = getDistanceBetweenPoints2D ( x,y, x2,y2 ) -- you can use getDistanceBetweenPoints3D if want if (Distance <= 10) then outputChatBox(Mens,Pl) --else --cancelEvent() end end end end addEventHandler("onPlayerChat",getRootElement(),meCom)
  3. you can use elementData or triggers, i think
  4. try, no tested XatD = true function checkMoney(thePlayer, command) if (XatD == true) then local money = getPlayerMoney(thePlayer) outputChatBox(getPlayerName (thePlayer).. "has got :" .. tostring(money), root,0,255,0) XatD = false setTimer(function() XatD = true end,30000,1) end end addCommandHandler("checkMoney", checkMoney)
  5. probar local TableComand = {} local TableTimer = {} function checkMoney(thePlayer, command) if (TableComand[thePlayer] == false ) or not TableComand[thePlayer] then local money = getPlayerMoney(thePlayer) outputChatBox(getPlayerName (thePlayer).. "has got :" .. tostring(money), root,0,255,0) TableComand[thePlayer] = true TableTimer[thePlayer] = setTimer(function() TableComand[thePlayer] = false end,30000,1) end end addCommandHandler("checkMoney", checkMoney)
  6. in createProjectile function use creator to localPlayer
  7. is there any way to do it?
  8. yes, is server side. No work, I want to kick, the player if he digite /bind anycommand
  9. simples jogue cada um e verá a diferença
  10. try addCommandHandler ( "setxp", function ( thePlayer, _,who,XP ) local XP = tonumber ( XP ) or 0 local lPlayer = getPlayerFromName ( who ) if ( lPlayer ) then setElementData( lPlayer,"exp",XP ) end end )
  11. function BindOnS(commando) local accName = getAccountName(getPlayerAccount(source)) -- if isObjectInACLGroup ("user."..accName,aclGetGroup("Admin")) then return end if string.find(commando,"bind") then kickPlayer(source,"Não use bind's") end end addEventHandler("onPlayerCommand",getRootElement(),BindOnS) what's erros?
  12. Thank you! sorry about that
  13. manawydan

    bug 1.3.4?

    when players come into my server, this error appears: #1003 client script error: is invalid and will no work in future versions. please re-compile at https://luac.multitheftauto.com/ what would that be? started when I upgraded to version 1.3.4.
  14. try local antiSpam = {} function UnmuteSpam (thePlayer, _,target) target = tostring(target) if isTimer (antiSpam[target]) then killTimer (antiSpam[target]) outputChatBox("This player is now unmuted") else outputChatBox("This player wasn't muted") end end addCommandHandler("um", UnmuteSpam) function timerDetails(source) if isTimer(antiSpam[source]) then remaining, executesRemaining, totalExecutes = getTimerDetails( antiSpam[source] ) outputChatBox("Time remaining until chat free: ( remaining ), wait please.") else outputChatBox("You are free to speak") end end addCommandHandler("sleft", timerDetails)
  15. try function sp(player) local vehicle = getPedOccupiedVehicle ( player) setElementSpeed(vehicle, "kph", 50) end function bind() bindKey (source, "mouse1" , "down" , sp) end addEventHandler ("onPlayerVehicleEnter",getRootElement(),bind) function setElementSpeed(element, unit, speed) -- only work if element is moving! if (unit == nil) then unit = 0 end if (speed == nil) then speed = 0 end speed = tonumber(speed) local acSpeed = getElementSpeed(element, unit) if (acSpeed~=false) then -- if true - element is valid, no need to check again local diff = speed/acSpeed local x,y,z = getElementVelocity(element) setElementVelocity(element,x*diff,y*diff,z*diff) return true end return false end function getElementSpeed(element,unit) if (unit == nil) then unit = 0 end if (isElement(element)) then local x,y,z = getElementVelocity(element) if (unit=="mph" or unit==1 or unit =='1') then return (x^2 + y^2 + z^2) ^ 0.5 * 100 else return (x^2 + y^2 + z^2) ^ 0.5 * 1.8 * 100 end else outputDebugString("Not an element. Can't get speed") return false end end
  16. i think addCommandHandler no had source, use thePlayer
  17. acredito que voce tera que modificar o freeroam
  18. acredito que ele esta usando corona sdk, para criar jogos de celular eu acredito.
  19. desculpe cara, faço tutoriais simples porque eu sei pouca coisa de script e de lua. Se você tiver tempo poderia fazer tutoriais avançados, poderia ajudar muitos inclusive eu obrigado!
  20. setTimer setElementHealth getElementHealth
  21. setElementData getElementData table
  22. local TWeapon = {} local ColShape = createColRectangle (fX,fY,fWidth,fHeight) function ColHit(Element) if getElementType(Element) == "player" then if ( not TWeapon [ Element ] ) then TWeapon [ Element ] = { } end for slot = 0, 12 do local weapon = getPedWeapon ( Element, slot ) if ( weapon > 0 ) then local ammo = getPedTotalAmmo ( Element, slot ) if ( ammo > 0 ) then TWeapon [ Element ] [ weapon ] = ammo end end end end end addEventHandler("onColShapeHit",ColShape,ColHit) function ColLeave(Element) if getElementType(Element) == "player" then if (TWeapon [ Element ]) then for weapon, ammo in pairs ( TWeapon [ Element ] ) do giveWeapon ( Element, tonumber ( weapon ), tonumber ( ammo ) ) end end end TWeapon [ Element ] = nil end addEventHandler("onColShapeLeave",ColShape,ColLeave) gracias por el ejemplo SolidSnake14
×
×
  • Create New...