Jump to content

Chaos

Members
  • Posts

    300
  • Joined

  • Last visited

Everything posted by Chaos

  1. local mutedSerials = { } function muteSomeone ( player, cmd, target, reason, time ) if ( target and reason and time ) then local target = getPlayerFromName ( target ) if ( not isElement ( target ) ) then outputChatBox ( "There is no player with this name", player, 255, 255, 0 ) return end local time = tonumber ( time ) if ( time and time >= 1 and not isPlayerMuted ( target ) ) then local milliseconds = math.floor ( time * 60000 ) outputChatBox ( getPlayerName ( target ) .." has been muted for ".. tostring ( time ) .." minutes (".. reason ..") .", root, 255, 0, 0 ) setPlayerMuted ( target, true ) setTimer ( setPlayerMuted, milliseconds, 1, target, false ) mutedSerials [ getPlayerSerial ( target ) ] = milliseconds else outputChatBox ( "Syntax: /mmute player reason time and player cannot be muted", player, 255, 255, 0 ) end end end addCommandHandler ( "mmute", muteSomeone ) function afterreconnect (source) local milliseconds = mutedSerials [ getPlayerSerial ( source ) ] if ( milliseconds ) then setPlayerMuted ( source, true ) end end addEventHandler ( "onPlayerJoin", getRootElement(), afterreconnect ) not working when i reconnect and i will get unmuted when reconnect
  2. is that true ? local mutedSerials = { } function muteSomeone ( player, cmd, target, reason, time ) if ( target and reason and time ) then local target = getPlayerFromName ( target ) if ( not isElement ( target ) ) then outputChatBox ( "There is no player with this name", player, 255, 255, 0 ) return end local time = tonumber ( time ) if ( time and time >= 1 and not isPlayerMuted ( target ) ) then local milliseconds = math.floor ( time * 60000 ) outputChatBox ( getPlayerName ( target ) .." has been muted for ".. tostring ( time ) .." minutes (".. reason ..") .", root, 255, 0, 0 ) setPlayerMuted ( target, true ) setTimer ( setPlayerMuted, milliseconds, 1, target, false ) mutedSerials [ getPlayerSerial ( target ) ] = milliseconds else outputChatBox ( "Syntax: /mmute player reason time and player cannot be muted", player, 255, 255, 0 ) end end end addCommandHandler ( "mmute", muteSomeone ) function afterreconnect (target) local milliseconds = mutedSerials [ getPlayerSerial ( source ) ] if ( milliseconds ) then outputChatBox ( getPlayerName ( target ) .." has been muted by Console", root, 255, 0, 0 ) setPlayerMuted ( target, true ) end end addEventHandler ( "onPlayerJoin", getRootElement(), afterreconnect
  3. can you simplify more or show me an example
  4. well it's working but how can i save the time when some player reconnect?
  5. Chaos

    help

    hi, when i alaways enter to server that's appear can you help me please ? Error downloading requested files. HTTP resonse code said error. [The requested URL returned error: 404 not found ] [freeroam/fr_client.lua]
  6. like this ? setTimer(setPlayerMuted(muted, false), time*60*1000, 1)
  7. hi, im trying to make mute command but the problem is with time when i mute someone 4 min he will be muted for 24000 minutes function muteSomeone(player, cmd, target, reason, time) if (target and reason and time) then local target = getPlayerFromName(target) if (not isElement(target)) then outputChatBox("There is no player with this name", player, 255, 255, 0) return end if (tonumber(time) and tonumber(time) >= 1 and not isPlayerMuted(target)) then local minutes = math.floor(time * 60 * 1000) outputChatBox(getPlayerName(target).." has been muted for "..tostring(minutes).." minutes ("..reason..") .", root,255, 0, 0) setPlayerMuted(target, true) else outputChatBox("Syntax: /mmute player reason time and player cannot be muted", player, 255, 255, 0) end end end addCommandHandler("mmute", muteSomeone)
  8. hi, is there a way or function to disable that checkbox when a player join to the server ?
  9. Chaos

    buug

    thanks man
  10. Chaos

    buug

    hello i have problem with dxdraw can you help me? addEventHandler("onClientRender", root, function() local myfont = dxCreateFont("ZOMBI.ttf", 20 ) local myfont1 = dxCreateFont("ZOMBI.ttf", 32 ) dxDrawText("$0",815,125,988,188, tocolor(0, 200, 0, 255), 1, myfont1, "left", "top", false, false, false) dxDrawText(" 100%", 885, 61, 946, 93, tocolor(255, 0, 0, 255), 1, myfont, "left", "top", false, false, false) dxDrawText(" 100%", 885, 88, 946, 120, tocolor(255, 255, 255, 255), 1, myfont, "left", "top", false, false, false) end )
  11. Chaos

    multi ColCuboid

    thx mates its worked
  12. Chaos

    multi ColCuboid

    debug 17:unfinished string near ""onColShapeHit, Colshape [ i ],' local Colshape = { } local ColShapes = { { -435.35120, 1127.09399, 64.77347, 89.786315917969, 138.08850097656, 31.516172409058 }, { -539.83765, 1099.35901, -0.24455, 63.918670654297, 108.96557617188, 26.398180007935 }, { -478.33630, 1126.67896, 1.00000, 89.334411621094, 38.739135742188, 79.651779174805}, {-354.53192, 1107.53027, 69.47218, 48.932952880859, 113.24426269531, 23.160528182983}, {-305.90366, 929.78162, 66.37509, 44.974731445313, 177.42919921875, 29.443685531616}, {-305.33679, 1107.58313, 65.53906, 16.306518554688, 114.54858398438, 27.093648910522}, {-316.93121, 1054.64819, 65.19218, 55.719940185547, 52.712158203125, 8.1574993133545} -- The example } for i,v in ipairs ( ColShapes ) do Colshape [ i ] = createColCuboid ( v [ 1 ], v [ 2 ], v [ 3 ], v [ 4 ], v [ 5 ], v [ 6 ], v [7] ) end addEventHandler ( "onColShapeHit, Colshape [ i ], function ( ) outputChatBox("Welcome",source,0,255,0) end )
  13. Chaos

    multi ColCuboid

    and what about events how it will be?
  14. Chaos

    multi ColCuboid

    how to make it table can you give me an example
  15. hi, i have a question how to make a multi colcuboid Zone2 = createColCuboid(-435.35120, 1127.09399, 64.77347, 89.786315917969, 138.08850097656, 31.516172409058) Zone3 = createColCuboid(-539.83765, 1099.35901, -0.24455, 63.918670654297, 108.96557617188, 26.398180007935) Zone4 = createColCuboid(-478.33630, 1126.67896, 1.00000, 89.334411621094, 38.739135742188, 79.651779174805) Zone5 = createColCuboid(-354.53192, 1107.53027, 69.47218, 48.932952880859, 113.24426269531, 23.160528182983) Zone6 = createColCuboid(-305.90366, 929.78162, 66.37509, 44.974731445313, 177.42919921875, 29.443685531616) Zone7 = createColCuboid(-305.33679, 1107.58313, 65.53906, 16.306518554688, 114.54858398438, 27.093648910522) Zone8 = createColCuboid(-316.93121, 1054.64819, 65.19218, 55.719940185547, 52.712158203125, 8.1574993133545) should i make a table ?
  16. when a player use weapon like flame the other players will burning and then will dead and the friendlyfire is on
  17. the friendlyfire works fine plz read the topic
  18. hi, i have problem with friendlyfire when a player use weapons Cause fires like flame or rpg the other wise will dead due to fire. for _, v in ipairs ( getElementsByType 'team' ) do setTeamFriendlyFire ( v, false ) end
  19. Chaos

    freeroam problem

    see it CONTROL_MARGIN_RIGHT = 5 LINE_MARGIN = 5 LINE_HEIGHT = 16 g_Root = getRootElement() g_ResRoot = getResourceRootElement(getThisResource()) g_Me = getLocalPlayer() server = createServerCallInterface() guiSetInputMode("no_binds_when_editing") --------------------------- -- Set skin window --------------------------- --------------------------- --- Set animation window --------------------------- function applyAnimation(leaf) if type(leaf) ~= 'table' then leaf = getSelectedGridListLeaf(wndAnim, 'animlist') if not leaf then return end end server.setPedAnimation(g_Me, leaf.parent.name, leaf.name, true, true) end function stopAnimation() server.setPedAnimation(g_Me, false) end wndAnim = { 'wnd', text = 'Set animation', width = 250, x = -20, y = 0.3, controls = { { 'lst', id='animlist', width=230, height=290, columns={ {text='Animation', attr='name'} }, rows={xml='animations.xml', attrs={'name'}}, expandlastlevel=false, onitemdoubleclick=applyAnimation }, {'btn', id='set', onclick=applyAnimation}, {'btn', id='stop', onclick=stopAnimation}, {'btn', id='close', closeswindow=true} } } addCommandHandler('anim', function(command, lib, name) server.setPedAnimation(g_Me, lib, name, true, true) end ) --------------------------- -- Weapon window --------------------------- --------------------------- -- Fighting style --------------------------- --------------------------- -- Clothes window --------------------------- function clothesInit() if getElementModel(g_Me) ~= 0 then errMsg('You must have the CJ skin set in order to apply clothes.') closeWindow(wndClothes) return end if not g_Clothes then triggerServerEvent('onClothesInit', g_Me) end end addEvent('onClientClothesInit', true) addEventHandler('onClientClothesInit', g_Root, function(clothes) g_Clothes = clothes.allClothes for i,typeGroup in ipairs(g_Clothes) do for j,cloth in ipairs(typeGroup.children) do if not cloth.name then cloth.name = cloth.model .. ' - ' .. cloth.texture end cloth.wearing = clothes.playerClothes[typeGroup.type] and clothes.playerClothes[typeGroup.type].texture == cloth.texture and clothes.playerClothes[typeGroup.type].model == cloth.model or false end table.sort(typeGroup.children, function(a, b) return a.name < b.name end) end bindGridListToTable(wndClothes, 'clothes', g_Clothes, false) end ) function clothListClick(cloth) setControlText(wndClothes, 'addremove', cloth.wearing and 'remove' or 'add') end function applyClothes(cloth) if not cloth then cloth = getSelectedGridListLeaf(wndClothes, 'clothes') if not cloth then return end end if cloth.wearing then cloth.wearing = false setControlText(wndClothes, 'addremove', 'add') server.removePlayerClothes(g_Me, cloth.parent.type) else local prevClothIndex = table.find(cloth.siblings, 'wearing', true) if prevClothIndex then cloth.siblings[prevClothIndex].wearing = false end cloth.wearing = true setControlText(wndClothes, 'addremove', 'remove') server.addPedClothes(g_Me, cloth.texture, cloth.model, cloth.parent.type) end end wndClothes = { 'wnd', text = 'Clothes', x = -20, y = 0.3, width = 350, controls = { { 'lst', id='clothes', width=330, height=390, columns={ {text='Clothes', attr='name', width=0.6}, {text='Wearing', attr='wearing', enablemodify=true, width=0.3} }, rows={ {name='Retrieving clothes list...'} }, onitemclick=clothListClick, onitemdoubleclick=applyClothes }, {'br'}, {'btn', text='add', id='addremove', width=60, onclick=applyClothes}, {'btn', id='close', closeswindow=true} }, oncreate = clothesInit } function addClothesCommand(cmd, type, model, texture) type = type and tonumber(type) if type and model and texture then server.addPedClothes(g_Me, texture, model, type) end end addCommandHandler('addclothes', addClothesCommand) addCommandHandler('ac', addClothesCommand) function removeClothesCommand(cmd, type) type = type and tonumber(type) if type then server.removePlayerClothes(g_Me, type) end end addCommandHandler('removeclothes', removeClothesCommand) addCommandHandler('rc', removeClothesCommand) --------------------------- -- Player gravity window --------------------------- --------------------------- -- Warp to player window --------------------------- --------------------------- -- Stats window --------------------------- --------------------------- -- Bookmarks window --------------------------- --------------------------- -- Jetpack toggle --------------------------- --------------------------- -- Fall off bike toggle --------------------------- function toggleFallOffBike() setPedCanBeKnockedOffBike(g_Me, guiCheckBoxGetSelected(getControl(wndMain, 'falloff'))) end --------------------------- -- Set position window --------------------------- --------------------------- -- Spawn map window --------------------------- --------------------------- -- Interior window --------------------------- --------------------------- -- Create vehicle window --------------------------- --------------------------- -- Repair vehicle --------------------------- function repairVehicle() local vehicle = getPedOccupiedVehicle(g_Me) if vehicle then server.fixVehicle(vehicle) end end addCommandHandler('repair', repairVehicle) addCommandHandler('rp', repairVehicle) --------------------------- -- Flip vehicle --------------------------- function flipVehicle() local vehicle = getPedOccupiedVehicle(g_Me) if vehicle then local rX, rY, rZ = getElementRotation(vehicle) server['set' .. 'VehicleRotation'](vehicle, 0, 0, (rX > 90 and rX < 270) and (rZ + 180) or rZ) end end
  20. Chaos

    freeroam problem

    yes i modified it before CONTROL_MARGIN_RIGHT = 5 LINE_MARGIN = 5 LINE_HEIGHT = 16 g_Root = getRootElement() g_ResRoot = getResourceRootElement(getThisResource()) g_Me = getLocalPlayer() server = createServerCallInterface() guiSetInputMode("no_binds_when_editing") --------------------------- -- Set skin window --------------------------- --------------------------- --- Set animation window --------------------------- function applyAnimation(leaf) if type(leaf) ~= 'table' then leaf = getSelectedGridListLeaf(wndAnim, 'animlist') if not leaf then return end end server.setPedAnimation(g_Me, leaf.parent.name, leaf.name, true, true) end function stopAnimation() server.setPedAnimation(g_Me, false) end wndAnim = { 'wnd', text = 'Set animation', width = 250, x = -20, y = 0.3, controls = { { 'lst', id='animlist', width=230, height=290, columns={ {text='Animation', attr='name'} }, rows={xml='animations.xml', attrs={'name'}}, expandlastlevel=false, onitemdoubleclick=applyAnimation }, {'btn', id='set', onclick=applyAnimation}, {'btn', id='stop', onclick=stopAnimation}, {'btn', id='close', closeswindow=true} } } addCommandHandler('anim', function(command, lib, name) server.setPedAnimation(g_Me, lib, name, true, true) end ) --------------------------- -- Weapon window --------------------------- --------------------------- -- Fighting style --------------------------- --------------------------- -- Clothes window --------------------------- function clothesInit() if getElementModel(g_Me) ~= 0 then errMsg('You must have the CJ skin set in order to apply clothes.') closeWindow(wndClothes) return end if not g_Clothes then triggerServerEvent('onClothesInit', g_Me) end end addEvent('onClientClothesInit', true) addEventHandler('onClientClothesInit', g_Root, function(clothes) g_Clothes = clothes.allClothes for i,typeGroup in ipairs(g_Clothes) do for j,cloth in ipairs(typeGroup.children) do if not cloth.name then cloth.name = cloth.model .. ' - ' .. cloth.texture end cloth.wearing = clothes.playerClothes[typeGroup.type] and clothes.playerClothes[typeGroup.type].texture == cloth.texture and clothes.playerClothes[typeGroup.type].model == cloth.model or false end table.sort(typeGroup.children, function(a, b) return a.name < b.name end) end bindGridListToTable(wndClothes, 'clothes', g_Clothes, false) end ) function clothListClick(cloth) setControlText(wndClothes, 'addremove', cloth.wearing and 'remove' or 'add') end function applyClothes(cloth) if not cloth then cloth = getSelectedGridListLeaf(wndClothes, 'clothes') if not cloth then return end end if cloth.wearing then cloth.wearing = false setControlText(wndClothes, 'addremove', 'add') server.removePlayerClothes(g_Me, cloth.parent.type) else local prevClothIndex = table.find(cloth.siblings, 'wearing', true) if prevClothIndex then cloth.siblings[prevClothIndex].wearing = false end cloth.wearing = true setControlText(wndClothes, 'addremove', 'remove') server.addPedClothes(g_Me, cloth.texture, cloth.model, cloth.parent.type) end end wndClothes = { 'wnd', text = 'Clothes', x = -20, y = 0.3, width = 350, controls = { { 'lst', id='clothes', width=330, height=390, columns={ {text='Clothes', attr='name', width=0.6}, {text='Wearing', attr='wearing', enablemodify=true, width=0.3} }, rows={ {name='Retrieving clothes list...'} }, onitemclick=clothListClick, onitemdoubleclick=applyClothes }, {'br'}, {'btn', text='add', id='addremove', width=60, onclick=applyClothes}, {'btn', id='close', closeswindow=true} }, oncreate = clothesInit } function addClothesCommand(cmd, type, model, texture) type = type and tonumber(type) if type and model and texture then server.addPedClothes(g_Me, texture, model, type) end end addCommandHandler('addclothes', addClothesCommand) addCommandHandler('ac', addClothesCommand) function removeClothesCommand(cmd, type) type = type and tonumber(type) if type then server.removePlayerClothes(g_Me, type) end end addCommandHandler('removeclothes', removeClothesCommand) addCommandHandler('rc', removeClothesCommand) --------------------------- -- Player gravity window --------------------------- --------------------------- -- Warp to player window --------------------------- --------------------------- -- Stats window --------------------------- --------------------------- -- Bookmarks window --------------------------- --------------------------- -- Jetpack toggle --------------------------- --------------------------- -- Fall off bike toggle --------------------------- function toggleFallOffBike() setPedCanBeKnockedOffBike(g_Me, guiCheckBoxGetSelected(getControl(wndMain, 'falloff'))) end --------------------------- -- Set position window --------------------------- --------------------------- -- Spawn map window --------------------------- --------------------------- -- Interior window --------------------------- --------------------------- -- Create vehicle window --------------------------- --------------------------- -- Repair vehicle --------------------------- function repairVehicle() local vehicle = getPedOccupiedVehicle(g_Me) if vehicle then server.fixVehicle(vehicle) end end addCommandHandler('repair', repairVehicle) addCommandHandler('rp', repairVehicle) --------------------------- -- Flip vehicle --------------------------- function flipVehicle() local vehicle = getPedOccupiedVehicle(g_Me) if vehicle then local rX, rY, rZ = getElementRotation(vehicle) server['set' .. 'VehicleRotation'](vehicle, 0, 0, (rX > 90 and rX < 270) and (rZ + 180) or rZ) end end
×
×
  • Create New...