Jump to content

Turbe$Z

Members
  • Posts

    439
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by Turbe$Z

  1. exports.scoreboard:addScoreboardColumn('Játszott idő') local t = { } function checkValues( source,arg1,arg2) if (arg2 >= 60) then t[ source ][ 'min' ] = tonumber( t[ source ][ 'min' ] or 0 ) + 1 t[ source ][ 'sec' ] = 0 end if (arg1 >= 60) then t[ source ][ 'min' ] = 0 t[ source ][ 'hours' ] = tonumber( t[ source ][ 'hours' ] or 0 ) + 1 end return arg1, arg2 end setTimer( function( ) for _, v in pairs( getElementsByType( "player" ) ) do if (not t[ v ]) then t[ v ] = { ["hours"] = 0, ["min"] = 0, ["sec"] = 0 } end t[ v ][ 'sec' ] = tonumber( t[ v ][ 'sec' ] or 0 ) + 1 local min,sec = checkValues ( v, t[ v ][ 'min' ] or 0, t[ v ][ 'sec' ] or 0 ) local hours = tonumber( t[ v ][ 'hours' ] or 0 ) setElementData( v, "Játszott idő", tostring( hours )..' óra '..tostring( min )..' perc' ) end end, 1000, 0 ) function onPlayerQuit ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then local sValue = getElementData( source,'Játszott idő' ) local hours = tonumber( t[ source ][ 'hours' ] or 0 ) local min = tonumber( t[ source ][ 'min' ] or 0 ) local sec = tonumber( t[ source ][ 'sec' ] or 0 ) setAccountData ( playeraccount, "Játszott idő-hours", tostring(hours) ) setAccountData ( playeraccount, "Játszott idő-min", tostring(min) ) setAccountData ( playeraccount, "Játszott idő-sec", tostring(sec) ) setAccountData ( playeraccount, "Játszott idő", tostring(sValue) ) end t[ source ] = nil end function onPlayerLogin (_, playeraccount ) if ( playeraccount ) then local time = getAccountData ( playeraccount, "Játszott idő" ) local hou = getAccountData ( playeraccount, "Játszott idő-hours") local min = getAccountData ( playeraccount, "Játszott idő-min") local sec = getAccountData ( playeraccount, "Játszott idő-sec") if ( time ) then setElementData ( source, "Játszott idő", time ) t[ source ]["hours"] = tonumber(hou) t[ source ]["min"] = tonumber(min) t[ source ]["sec"] = tonumber(sec) else setElementData ( source, "Játszott idő",0 ) setAccountData ( playeraccount, "Játszott idő",0 ) end end end addEventHandler ( "onPlayerQuit", root, onPlayerQuit ) addEventHandler ( "onPlayerLogin", root, onPlayerLogin ) function dependent(player) local accountName = getAccountName ( getPlayerAccount ( player ) ) local minek = (tonumber(getAccountData ( getPlayerAccount ( player ), min)) or 0)/3600 if minek >= 1 then if aclGroupAddObject (aclGetGroup("SuperModerator"), "user."..accountName) == true then outputChatBox("You are now in group SuperModerator",player) end end end This why not working?
  2. no, i want, when player have xy hour or minute, then add to a aclgroup
  3. no i added 'resource.jatszottido' to admin group
  4. changed, but the script doesn't add me to the aclgroup
  5. function dependent(player) local accountName = getAccountName ( getPlayerAccount ( player ) ) local hour = getAccountData ( playeraccount, "Játszott idő-hours") if hour = 30 then aclGroupAddObject (aclGetGroup("Dependent"), "user."..accountName) end end i got this error: [22:44:11] ERROR: Loading script failed: jatszottido\ji.lua:86: 'then' expected near '=' how to fix this?
  6. how to disable others to lift me?
  7. wait, when i disable the gravity gun, i can't to lift players, and vehicles, but others can me to lift why?
  8. i downloaded this script: https://community.multitheftauto.com/index.php?p=resources&s=details&id=11102 and added to my server, but some player doesn't want to raise, and i want create a /antigg script, that they could not lift players, but i don't know how. anyone can help? /sorry for my bad English/
  9. function autostat(thePlayer) setPlayerStat(thePlayer, 24, 1000) setElementHealth(thePlayer, 255) end addEventHandler("onResourceStart", resourceRoot, autostat) i got this warnings: [22:09:28] WARNING: autostat\autostat.lua:2: Bad argument @ 'setPlayerStat' [Expected element at argument 1, got resource-data] [22:09:34] WARNING: autostat\autostat.lua:3: Bad argument @ 'setElementHealth' [Expected element at argument 1, got resource-data]
  10. --------------------------- -- Weapon window --------------------------- function addWeapon(leaf, amount) if isCommandOnCD("giveweapon", true) then return end if type(leaf) ~= 'table' then leaf = getSelectedGridListLeaf(wndWeapon, 'weaplist') amount = getControlNumber(wndWeapon, 'amount') if not amount or not leaf or not leaf.id then return end end server.giveMeWeapon(leaf.id, amount) end wndWeapon = { 'wnd', text = 'fegyverek', width = 250, controls = { { 'lst', id='weaplist', width=230, height=280, columns={ {text='Fegyver', attr='name'} }, rows={xml='weapons.xml', attrs={'id', 'name'}}, onitemdoubleclick=function(leaf) addWeapon(leaf, 500) end }, {'br'}, {'txt', id='töltény', text='500', width=60}, {'btn', id='ok', onclick=addWeapon}, {'btn', id='bezár', closeswindow=true} } } function giveWeaponCommand(cmd, weapon, amount) if isCommandOnCD(cmd) then return end weapon = tonumber(weapon) or getWeaponIDFromName(weapon) if not weapon then return end amount = amount and tonumber(amount) or 500 server.giveMeWeapon(math.floor(weapon), amount) end addCommandHandler('give', giveWeaponCommand) addCommandHandler('wp', giveWeaponCommand) --------------------------- -- Main window --------------------------- function updateGUI(updateVehicle) -- update position local x, y, z = getElementPosition(g_Me) setControlNumbers(wndMain, {xpos=math.ceil(x), ypos=math.ceil(y), zpos=math.ceil(z)}) -- update jetpack toggle guiCheckBoxSetSelected( getControl(wndMain, 'jetpack'), doesPedHaveJetPack(g_Me) ) if updateVehicle then -- update current vehicle local vehicle = getPedOccupiedVehicle(g_Me) if vehicle and isElement(vehicle) then setControlText(wndMain, 'curvehicle', getVehicleName(vehicle)) else setControlText(wndMain, 'curvehicle', 'On foot') end end end function mainWndShow() if not getPedOccupiedVehicle(g_Me) then hideControls(wndMain, 'repair', 'flip', 'upgrades', 'color', 'paintjob', 'lightson', 'lightsoff') end updateTimer = updateTimer or setTimer(updateGUI, 2000, 0) updateGUI(true) end function mainWndClose() killTimer(updateTimer) updateTimer = nil colorPicker.closeSelect() end function onEnterVehicle(vehicle) setControlText(wndMain, 'curvehicle', getVehicleName(vehicle)) showControls(wndMain, 'repair', 'flip', 'upgrades', 'color', 'paintjob', 'lightson', 'lightsoff') guiCheckBoxSetSelected(getControl(wndMain, 'lightson'), getVehicleOverrideLights(vehicle) == 2) guiCheckBoxSetSelected(getControl(wndMain, 'lightsoff'), getVehicleOverrideLights(vehicle) == 1) end function onExitVehicle(vehicle) setControlText(wndMain, 'curvehicle', 'On foot') hideControls(wndMain, 'repair', 'flip', 'upgrades', 'color', 'paintjob', 'lightson', 'lightsoff') closeWindow(wndUpgrades) closeWindow(wndColor) end function killLocalPlayer() server.killPed(g_Me) end function alphaCommand(command, alpha) alpha = alpha and tonumber(alpha) if alpha then server.setElementAlpha(g_Me, alpha) end end addCommandHandler('alpha', alphaCommand) addCommandHandler('ap', alphaCommand) addCommandHandler('kill', killLocalPlayer) addEventHandler( 'onClientPlayerChangeNick', g_Me, function( old, new ) guiSetText ( getControl ( wndMain, 'plrname' ), new ) end ) function togglewarptome() if ( guiCheckBoxGetSelected( getControl ( wndMain, 'togglewarptme' ) ) == true ) then setElementData( g_Me, 'isWarpEnabled', 'false' ) else setElementData( g_Me, 'isWarpEnabled', nil ) end end wndMain = { 'wnd', text = 'FR GUI', x = 10, y = 150, width = 280, alpha = 1.0, controls = { {'lbl', id='myPos', text='Pozíciód:', width=80, height = 20}, {'lbl', id='xpos', text='x', width=45}, {'lbl', id='ypos', text='y', width=45}, {'lbl', id='zpos', text='z', width=45}, {'br'}, {'lbl', id='linelbl1', text='====================================================', width=250, height = 20}, {'br'}, {'btn', id='Öngyilkosság', onclick=killLocalPlayer, width=80, height = 20}, {'btn', id='Kinézet', window=wndSkin, width=80, height = 20}, {'btn', id='Animáció', window=wndAnim, width=80, height = 20}, {'btn', id='Ruhák(CJ)', window=wndClothes, width=80, height = 20}, {'btn', id='playergrav', text='Gravitáció', window=wndGravity, width=80, height = 20}, {'btn', id='Teleport', window=wndWarp, width=80, height = 20}, {'btn', id='Statisztika', window=wndStats, width=80, height = 20}, {'btn', id='Helyeid', window=wndBookmarks, width=80, height = 20}, {'btn', id='Fegyverek', window=wndWeapon, width=80, height = 20}, {'br'}, {'chk', id='jetpack', onclick=toggleJetPack, width=80, height = 20}, {'chk', id='falloff', text='Motoresés', onclick=toggleFallOffBike, width=150, height = 20}, {'chk', id='togglewarptme', text='Teleportálás tiltása', onclick=togglewarptome, width=1000, height = 20}, {'br'}, {'lbl', id='linelbl2', text='====================================================', width=250, height = 20}, {'br'}, {'btn', id='setpos', text='Térkép', window=wndSetPos, width=80, height = 20}, {'btn', id='setinterior', text='Ház belsők', window=wndSetInterior, width=80, height = 20}, {'br'}, {'lbl', id='linelbl3', text='====================================================', width=250, height = 20}, {'br'}, {'lbl', id='vehlbl', text='Jármű:', width=80, height = 20}, {'br'}, {'lbl', id='curlbl', text='Jelenlegi:', width=80, height = 20}, {'lbl', id='curvehicle', width=80, height = 20}, {'br'}, {'btn', id='createvehicle', window=wndCreateVehicle, text='Létrehozás', width=80, height = 20}, {'btn', id='Javítás', onclick=repairVehicle, width=80, height = 20}, {'btn', id='Forgatás', onclick=flipVehicle, width=80, height = 20}, {'btn', id='Tuning', window=wndUpgrades, width=80, height = 20}, {'btn', id='Szín', onclick=openColorPicker, width=80, height = 20}, {'btn', id='Matrica', window=wndPaintjob, width=80, height = 20}, {'br'}, {'chk', id='lightson', text='Lámpák be', onclick=forceLightsOn, width=87, height = 20}, {'chk', id='lightsoff', text='Lámpák ki', onclick=forceLightsOff, width=87, height = 20}, }, oncreate = mainWndShow, onclose = mainWndClose } this is the fr_client.lua
  11. i downloaded a freeroam, in wich it was missing giveweapon button, and panel, i added from the default freeroam script, but doesn't working, does not give weapons how to fix this? /sorry for my bad English:c/
  12. i downloaded a fps and ping meter from community, and i want change the position local ping = getPlayerPing(getLocalPlayer()) local x, y = guiGetScreenSize ( ) local posx2,posy2 = x*0.1,y*0.1 local root = getRootElement() local player = getLocalPlayer() local counter = 0 local starttick local currenttick addEventHandler("onClientRender",root, function() if not starttick then starttick = getTickCount() end counter = counter + 1 currenttick = getTickCount() if currenttick - starttick >= 1000 then setElementData(player,"FPS",counter) counter = 0 starttick = false end end ) function drawStates () addEventHandler ( "onClientRender", root, pingState ) addEventHandler ( "onClientRender", root, fpsState ) end addEventHandler ( "onClientResourceStart", resourceRoot, drawStates ) function fpsState() local ping = getPlayerPing(getLocalPlayer()) posx2= x-55 posy2= 13 dxDrawText ( getElementData(getLocalPlayer(),"FPS"), posx2-118, posy2+18, x, y, tocolor ( 30, 144, 255, 255 ), 1.0, "default-bold" ) dxDrawText ( ping.." ms", posx2-23, posy2+18, x, y, tocolor ( 30, 144, 255, 255 ), 1.0, "default-bold" ) dxDrawText ( "FPS", posx2-120, posy2+33, x, y, tocolor ( 30, 144, 255, 255 ), 0.8, "default-bold" ) dxDrawText ( "PING", posx2-20, posy2+33, x, y, tocolor ( 30, 144, 255, 255 ), 0.8, "default-bold" ) end fileDelete("client.lua")
  13. In 1440x900 resolution, the dx elements they are in the right place, but in 1920x1080 the dx elements move up, and in 1366x768 the dx elements move down.. Why? how to fix this? the guigetscreensize is added with the correct coordinates..
×
×
  • Create New...