Jump to content

URBAN

Members
  • Posts

    45
  • Joined

  • Days Won

    1

Everything posted by URBAN

  1. Write openports on console may be u did something wrong
  2. reinstalling windows is best solution
  3. 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 )
  4. 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)
  5. 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 )
  6. 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)
  7. 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)
  8. https://github.com/davidm/lua-matrix/blob/master/lua/matrix.lua add matrix functions from there
  9. URBAN

    All RPG Scripts

    https://forum.multitheftauto.com/forum/149-looking-for-staff/
  10. stop play script // wrong section dude use https://forum.multitheftauto.com/forum/71-scripting/ next time
  11. We don't support leaked resources.
  12. addEventHandler("onPlayerChangeNick", root, function(oldNick, newNick) if string.len(newNick) <= 3 then setPlayerName(source,oldNick) end end)
  13. Use setTimer, getPedWeapon and toggleControl
  14. 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 )
  15. URBAN

    help DX box

    https://wiki.multitheftauto.com/wiki/IsMouseInPosition and bindKey
  16. Here is an example. Use shader_tex_names to get shader name.
  17. Call it on server side if you call in client it wont sync dimension or interior
  18. URBAN

    XML problem

    If its client sided check mta resources folder
  19. 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 )
  20. URBAN

    Fuel system

    if getVehicleType(source) == 'BMX' or getVehicleType(source) == 'Bike' or getVehicleType(source) == 'Quad' then return end
  21. Use gueditor resource to get position
  22. Or you can use shader you can add different skins per player
  23. 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
  24. Use setAccountData to store data and when player logins check it
  25. 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
×
×
  • Create New...