-
Posts
45 -
Joined
-
Days Won
1
Everything posted by URBAN
-
Write openports on console may be u did something wrong
-
addCommandHandler( 'respawn' , function( player , command , Name ) if ( getPlayerFromName( tostring( Name ) ) ~= false ) then spawnPlayer( getPlayerFromName( tostring( Name ) ) , 0 , 0 , 10 , 0 , tonumber( getElementModel( getPlayerFromName( tostring( Name ) ) )) ) end end )
-
addEventHandler("onResourceStart",root, function() if fileExists("log.txt") then log = fileOpen("log.txt") else log = fileCreate("log.txt") end end) addEventHandler("onPlayerCommand",root, function(command) fileWrite(file,getPlayerName(source).." used "..command.." command.".."\n" ) end)
-
addCommandHandler( 'respawn' , function( player , command , Name ) if ( getPlayerFromName( tostring( Name ) ) ~= false ) then spawnPlayer( getPlayerFromName( tostring( Name ) ) , 0 , 0 , 10 , 0 , tonumber( getElementModel(player) ) ) end end )
-
143. line at guimanager.lua function toggleEditor ( ) if getElementData(localPlayer,"admin") then else return end add somewhere at core.lua addEventHandler("onPlayerLogin", root, function() if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)),aclGetGroup("Admin")) then setElementData(source,"admin",true) end end)
-
local times = 0 function ada(chosenOption) if chosenOption == 9 then setElementData(root, "played", times+1) end end addEvent("onPollEnd",true,true) addEventHandler("onPollEnd", root,ada)
- 1 reply
-
- 1
-
https://github.com/davidm/lua-matrix/blob/master/lua/matrix.lua add matrix functions from there
-
https://forum.multitheftauto.com/forum/149-looking-for-staff/
-
stop play script // wrong section dude use https://forum.multitheftauto.com/forum/71-scripting/ next time
-
We don't support leaked resources.
-
addEventHandler("onPlayerChangeNick", root, function(oldNick, newNick) if string.len(newNick) <= 3 then setPlayerName(source,oldNick) end end)
-
function AutoFix() if ( guiCheckBoxGetSelected(GUIEditor.checkbox[1])) then --vehicles = getElementsByType ( "vehicle" ) -- for vehicleKey,vehicleValue in ipairs(vehicles) do vehicleValue = getPedOccupiedVehicle(localPlayer) if vehicleValue then else return end fixVehicle ( vehicleValue ) setTimer ( function() setElementHealth ( vehicleValue, 1000.0 ) end, 10000, 1 ) --end end end setTimer( AutoFix, 100, 0 )
-
https://wiki.multitheftauto.com/wiki/IsMouseInPosition and bindKey
-
If its client sided check mta resources folder
-
function height() local jet = doesPedHaveJetPack ( localPlayer ) local x,y,z = getElementPosition (getLocalPlayer()) local height = math.floor((z*0)) if ( jet ) then if isPedOnGround(localPlayer) then z = 0 end dxDrawText("Altitude: " .. (z).."", 17, 461, 110, 498, tocolor(254, 17, 17, 254), 0.50, "bankgothic", "left", "top", false) end end addEventHandler ( "onClientRender", getRootElement(), height )
-
if getVehicleType(source) == 'BMX' or getVehicleType(source) == 'Bike' or getVehicleType(source) == 'Quad' then return end
-
Use gueditor resource to get position
-
if reason == "1" then if isPlayerMuted(target) then return outputChatBox("Player is already muted.", player, 255, 0, 0) end if playeraccount then else return end if isGuestAccount(playeraccount) then return end setPlayerMuted(target, true) setAccountData(playeraccount, "mutedfor30secs", true) outputChatBox("* "..name.." has been muted by "..plrname.."!", root, 13, 107, 39, true) setTimer(setPlayerMuted,30*1000,1,target,false) setTimer(setAccountData,30*1000,1,playeraccount,"mutedfor30secs",false) setTimer(outputChatBox,30*1000,1,"unmuted",root) end function muteOnLogin(_, playeraccount) if playeraccount then else return end if isGuestAccount(playeraccount) then return end local muted = getAccountData(playeraccount, "mutedfor30secs") if muted then setPlayerMuted(source, true) outputChatBox("muted", root) setTimer(setPlayerMuted,30*1000,1,target,false) setTimer(setAccountData,30*1000,1,playeraccount,"mutedfor30secs",false) setTimer(outputChatBox,30*1000,1,"unmuted",root) end end addEventHandler("onPlayerLogin", root, muteOnLogin) -- addEventHandler("onPlayerQuit", root, -- function(_, playeraccount) -- if not muted then return end -- if not (playeraccount) and isGuestAccount(playeraccount) then return end -- local muted = getAccountData(playeraccount, "mutedfor30secs") -- setAccountData(playeraccount, "quit", true) -- end) -- dont need it u already stored mutedfor30secs
-
Use setAccountData to store data and when player logins check it
-
setElementCollisionsEnabled(car, false) to the car which i spawn, but the thing is once i spawn the vehicle, it goes directly up into the Air like there is none of Gravity if you know i mean, here is the code : ? allowedTeams = { ["Staff"] = true,} function spawner ( sourceplayer, commandname) if allowedTeams[getTeamName(getPlayerTeam( sourceplayer))]then local x, y, z = getElementPosition ( sourceplayer ) local location = getZoneName ( x, y, z ) local car = createVehicle ( 445, x, y, z) warpPedIntoVehicle ( sourceplayer, car ) setElementCollisionsEnabled(car, false) setVehiclePlateText( car, 'housing' ) setVehicleHandling(car , "maxVelocity", 40) setVehicleLocked ( car, true ) setVehicleDamageProof(car, true) local vehicleName = getVehicleName (car) outputChatBox ( "Your vehicle is being destroyed in few Seconds due to the Abuse", sourceplayer, 255, 255, 0 ) outputDebugString ( "Housing Admin: [" ..getPlayerName(sourceplayer).."] Has Spawned "..vehicleName.." At {" ..location.."}.") setTimer ( function() destroyElement (car) end, 25000, 1 ) else setElementCollisionsEnabled(car, true) outputDebugString ( "Housing Admin: [" ..getPlayerName(sourceplayer).."] Has Tried the Housing command.") end end addCommandHandler ( "spawn", spawner ) function out ( vehicle ) if vehicle then else return end if getElementData(vehicle,"housing") then else return end destroyElement(vehicle) end addEventHandler ( "onPlayerVehicleExit", getRootElement(), out ) I wrote it on phone so i couldnt delete spaces