Jump to content

IIYAMA

Moderators
  • Posts

    6,086
  • Joined

  • Last visited

  • Days Won

    215

Everything posted by IIYAMA

  1. IIYAMA

    Second Rhino

    dirty hax? It is just a simple overwrite using lua, if you know a little bit lua this isn't a big deal.
  2. Resources: Everything else about resources.
  3. IIYAMA

    Online time

    Wrong section.
  4. setElementModel isn't in the code you posted, pls get serious or I will stop helping you.
  5. How did you set-up your triggerServerEvent(??????) ?
  6. setplayerteam(source,team) setPlayerTeam(source,team) cancelEvent cancelEvent() Even so, cancelEvent has no function in this set-up.
  7. IIYAMA

    getAccountData

    You don't need to know the password, it is optional. account = getAccount ( string username ) -- or account = getAccount ( string username [, string password ] ) [ string password ] = optional
  8. IIYAMA

    getAccountData

    https://wiki.multitheftauto.com/wiki/GetAccount https://wiki.multitheftauto.com/wiki/Ge ... tsBySerial
  9. Your mistake: Parameters string fileName, bool success fileName: the file downloaded. success: whether successful or not. https://wiki.multitheftauto.com/wiki/On ... adComplete Success isn't the first parameter/variable!
  10. Try something like this: Client: addEventHandler("onClientPreRender",root, function () local vehicle = getPedOccupiedVehicle(localPlayer) if vehicle and local i, firstPlayer = next(getVehicleOccupants(vehicle)) if firstPlayer == localPlayer then if getElementHealth(vehicle) < 250 and not isVehicleDamageProof (vehicle) then setVehicleDamageProof(vehicle,true) triggerServerEvent("blowUpVehicle",vehicle) end end end end) Server: addEvent("blowUpVehicle",true) addEventHandler("blowUpVehicle",root, function () if isElement(source) then setVehicleDamageProof(source,true) local x,y,z = getElementPosition(source) createExplosion (x,y,z,0,client) local players = getVehicleOccupants(source) if players and next(players) then for i,player in pairs (players) do killPed(player) -- add here peds or something like that. end end end end)
  11. IIYAMA

    math problem

    Because results is defined 2 times and the one inside the function is a local. function divideThisValue(value) local value = value 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 return results end addEvent("onEstimatingOver", true) addEventHandler("onEstimatingOver", root, function() onFactoryWindowClose() if estimating then estimating = false end local valueof = tonumber(getElementData(getLocalPlayer(), "Rocks:iron")) or 0 if guiGetVisible(GUIEditors.window[1]) then local results = divideThisValue(valueof) if results then local copper = results[1] or 0 -- if it fails some how, which probably will not happen. local bronze = results[2] or 0 local silver = results[3] or 0 local iron = results[4] or 0 local gold = results[5] or 0 guiSetText(GUIEditors.copper, tostring(copper).." grams\n"..tonumber(copper*25).."$") guiSetText(GUIEditors.bronze, tostring(broze).." grams\n"..tonumber(bronze*35).." $") guiSetText(GUIEditors.silver, tostring(silver).." grams\n"..tonumber(silver*45).." $") guiSetText(GUIEditors.iron, tostring(iron).." grams\n"..tonumber(iron*46).." $") guiSetText(GUIEditors.gold, tostring(gold).." grams\n"..tonumber(gold*60).." $") end end end)
  12. 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"
  13. 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.
  14. 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.
  15. 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.
  16. Both ways are correct, since the player(the source) you are sending through will become the localPlayer.
  17. 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)
  18. 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
  19. Don't forget to unload it.
  20. 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.
×
×
  • Create New...