Jump to content

IIYAMA

Moderators
  • Posts

    6,097
  • Joined

  • Last visited

  • Days Won

    218

Everything posted by IIYAMA

  1. onPlayerQuit Parameters string quitType, string reason, element responsibleElement quitType: How the player left. This argument can be: "Unknown" "Quit" "Kicked" "Banned" "Bad Connection" "Timed out"
  2. 1.0.1 is released.
  3. IIYAMA

    math problem

    good question. But try something like this: -- setup -- local value = 500 local splitUpInParts = 5 ----------- local valuePeaks = (100/splitUpInParts)/100 local results = {} local valueInParts = math.floor((value/splitUpInParts)+0.5) local valueTotal = 0 for i=1,splitUpInParts-1 do local peak if math.random(2) == 1 then peak = math.random(math.floor((valueInParts*valuePeaks)+0.5)) else peak = -math.random(math.floor((valueInParts*valuePeaks)+0.5)) end local result = valueInParts+ peak results[#results+1] = result valueTotal = valueTotal+result end results[#results+1] = value - valueTotal -- rest value for i=1,5 do outputChatBox(results[i]) end This are the results from the demo The results do not have extreme ups and downs, but at least they will not be lower then zero.
  4. Next version will soon be released. New features: [b]- Setup weaponswitch speed limit (default).[/b] You can change the amount of time it takes to switch your weapon(also per player). [b]- SetJetpackWeapons enabled (default).[/b] Since the setJetpackWeaponEnabled has been released. Not much people have been able to get a lot of benefit from that, because you normaly can't switch your weapon while using a jetpack. But now you can. [b]- Export functions, so all settings can be edited from other resources.[/b] Exports: [color=#FF7F00]Setup weaponswitch speed limit. (save arg, overwrite players arg)[/color] [color=#FF7F00]Setup weaponswitch speed limit per player.[/color] [color=#FF7F00]Get weaponswitch speed limit.[/color] [color=#FF7F00]Get weaponswitch speed limit per player.[/color] [color=#FF7F00]Set jetpack weapons enabled.[/color] [color=#0000FF]Set player weaponswitch frozen.[/color] ■ Server ■ Client ■ Shared If there is stuff missing, let me know.
  5. Show updated code.
  6. Hmm, disagree with you. I am drawing my screen at 1920x1080, with 2 x 7970 cards(overkill) and yet I feel a strange kind of lagg. But that without using a shader, which you probably do.
  7. Both ways are correct, since the player(the source) you are sending through will become the localPlayer.
  8. local screenWidth, screenHeight = guiGetScreenSize ( ) local quality = 50 -- 1% t/m 100% local scalingFactor = quality/100 local myScreenSource = dxCreateScreenSource(screenWidth*scalingFactor, screenHeight*scalingFactor) Rendering with full resolution will lagg, because those functions are slow. And post all required variables next time, now I am just gambling what the problem might be. If it still does lagg after reducing the quality, you can also choose for an update after every 2 frames. (which will split up the fps in half)
  9. What happens if I don't unload it ? Security (hackers, etc..) ? Resource consumption ? No, it remains in your server ram, which gives you less ram for your other stuff. Not really a big deal for a small xml file, but when it gets larger it might starts to lagg. Even so I recommend you, to make unloading xml files a habit. https://wiki.multitheftauto.com/wiki/XmlUnloadFile
  10. Don't forget to unload it.
  11. if isTimer(iniciando[zoned]) then killTimer(iniciando[zoned]) end iniciando[zoned]= nil -- clean up You can't kill a timer which doesn't exist any more.
  12. Ops O_o @khalid-mks Thank you very much. Fixed the links.
  13. Change your weaponslot, without enabling too much glitches. Version 1.0.1: Exports: [color=#FF7F00]Setup weaponswitch speed limit. (save arg, overwrite players arg)[/color] [color=#FF7F00]Setup weaponswitch speed limit per player.[/color] [color=#FF7F00]Get weaponswitch speed limit.[/color] [color=#FF7F00]Get weaponswitch speed limit per player.[/color] [color=#FF7F00]Set jetpack weapons enabled.[/color] [url=http://s22.postimg.org/jvjglyuz3/mta_screen_2015_03_04_22_29_07.png]Screenshot.[/url] [color=#FF7F00]Get jetpack weapons enabled.[/color] [color=#0000FF]Set player weaponswitch frozen.[/color] ■ Server ■ Client ■ Shared Exports syntax:(server) setWeaponSwitchSpeedLimit ( int speed [, bool save = false, bool overwritePlayers = false]) return true/false, true/false, true/false getWeaponSwitchSpeedLimit ( ) return value setPlayerWeaponSwitchSpeedLimit ( player thePlayer, int speed) return true/false getPlayerWeaponSwitchSpeedLimit ( player thePlayer) return value setJetpackWeaponsEnabled ( bool status [, bool save = false ) return true/false, true/false getJetpackWeaponsEnabled ( ) return true/false setPlayerWeaponSwitchFrozen ( table/player, status ) return true/false Exports syntax:(client) setPlayerWeaponSwitchFrozen ( status ) return true/false How to use export functions? Download version 1.0.1
  14. As Solidsnake14 said, solution: if vehicle and getVehicleOverrideLights ( vehicle ) == 2 then
  15. and what doesn't work from the code? t "onPlayerHeadshot" weapons = {} weapons[33] = true addEventHandler("onPlayerDamage", getRootElement(), function (attacker, weapon, bodypart, loss) outputDebugString("event: onPlayerDamage") if bodypart == 9 and weapons[weapon] then outputDebugString("Bodypart = 9 and weapon is correct.") local result = triggerEvent("onPlayerHeadshot", source, attacker, weapon, loss) local result2 = triggerClientEvent(root, "onClientPlayerHeadshot", source, attacker, weapon, loss) outputDebugString("result = " .. tostring(result).. ", result2 = " .. tostring(result2)) if getPlayerTeam( source ) then outputDebugString("The player his team = " .. tostring(getTeamName( getPlayerTeam( source )))) else outputDebugString("The player isn't in a team.") end if result == true and result2 == true and getTeamName( getPlayerTeam( source ) ) == "Desert Storm" then setPedHeadless(source, true) killPed(source, attacker, weapon, bodypart) outputDebugString("Code successfully executed.") end end end ) -- addEventHandler("onPlayerSpawn", root, function() setPedHeadless(source, false) end) function returnHead() outputDebugString("Event: onPlayerSpawn") if isPedHeadless(source) then outputDebugString("pedHeadless restored") setPedHeadless(source,false) end end addEventHandler("onPlayerSpawn",root,returnHead) outputDebugString("code has been loaded successfully!")
  16. It is automatic defined, so don't have to write it down as parameter, or you will overwrite the source variable which will becomes useless. triggerClientEvent( source, -- = sending to "onPlayerArrested", -- event source, -- = source arrester, -- = first parameter whatEver, -- = second parameter whatEver2 -- = third parameter ----------------------------------------------------------------------------------------------------------- triggerClientEvent(source,"onPlayerArrested",source,arrester,whatEver,whatEver2) > addEvent("onPlayerArrested",true) function cuffed(arrester,whatEver,whatEver2) local mySource = source end addEventHandler("onPlayerArrested",getRootElement(),cuffed)
  17. function cuffed(arrester,source) function cuffed(arrester) Never define a source variable as a parameter. 11 % 10 = 1 21 % 10 = 1 55 % 10 = 5 53673465 % 10 = 5 390 % 360 = 30 721 % 360 = 1 Rest value = %
  18. IIYAMA

    Green Triangle

    np.
  19. IIYAMA

    Green Triangle

    Of course it is possible. https://wiki.multitheftauto.com/wiki/Se ... kerEnabled
  20. IIYAMA

    Crouching

    function dupa2 (thePlayer) setControlState(thePlayer, "crouch",true) setTimer(setControlState,100,1,thePlayer,"crouch",false) triggerClientEvent(source, "refreshInventoryManual", source) triggerClientEvent(source, "setControlStatus", source,false)-- true = enable, false = disable end addEvent("handcuffs", true) addEventHandler("handcuffs", getRootElement(), dupa2) local controlStatus = true function checkBrokenbone() if getElementData(getLocalPlayer(), "logedin") and controlStatus then if getElementData(getLocalPlayer(), "brokenbone") then if not isPedDucked(getLocalPlayer()) then end toggleControl("jump", false) -- there toggleControl("sprint", false) -- there else toggleControl("jump", true) -- and there toggleControl("sprint", true) -- and there end end end setTimer(checkBrokenbone, 1400, 0) addEvent("setControlStatus",true) addEventHandler("setControlStatus",localPlayer, function (status) toggleControl ( "walk", status) toggleControl ( "jump", status) toggleControl ( "crouch", status) toggleControl ( "sprint", status) toggleControl ( "fire", status ) toggleControl ( "next_weapon", status ) toggleControl ( "previous_weapon", status ) toggleControl ( "aim_weapon", status ) controlStatus = status end)
  21. IIYAMA

    Crouching

    Try execute this clientside: addEventHandler("onClientPreRender",root, function () if isPedDucked(localPlayer) then setControlState ("crouch",false) end end)
  22. Show me what you tried.
  23. By adding the tag on the event: https://wiki.multitheftauto.com/wiki/On ... DataChange and add this player on to a table so it will not happen again.
  24. When using root in an addEventHandler, it can accept every source element. When you use resourceRoot, it will only accept resourceRoot. This will become the source element from the addEventHandler: triggerServerEvent("KillAttacker",[color=#FF0000]source[/color],source)
  25. Use getPlayerName instead. It seems one of your resources is editing the name tag text for it's own purpose.
×
×
  • Create New...