-
Posts
980 -
Joined
-
Last visited
-
Days Won
1
Everything posted by manawydan
-
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)
-
you can use elementData or triggers, i think
-
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)
-
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)
-
in createProjectile function use creator to localPlayer
-
is there any way to do it?
-
yes, is server side. No work, I want to kick, the player if he digite /bind anycommand
-
lol You're welcome!
-
simples jogue cada um e verá a diferença
-
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 )
-
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?
-
Thank you! sorry about that
-
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.
-
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)
-
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
-
i think addCommandHandler no had source, use thePlayer
-
acredito que voce tera que modificar o freeroam
-
acredito que ele esta usando corona sdk, para criar jogos de celular eu acredito.
-
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!
-
setTimer setElementHealth getElementHealth
-
setElementData getElementData table
-
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