-
Posts
6,089 -
Joined
-
Last visited
-
Days Won
216
Everything posted by IIYAMA
-
I think, the bot is thinking for himself. So he has it's own priority. Setting him to following, will only have result when there is nothing to shoot at. But it is just a guess, since I took a peek in the resource a while ago.
-
You could try: https://wiki.multitheftauto.com/wiki/OnPlayerCommand and try to use a timer with 50 ms, to check if he logged in. https://wiki.multitheftauto.com/wiki/IsGuestAccount
-
lol, your previously code was better. Yet, mihayy5 his code is still the best solution, since getElementData only returns nil when the code fails, otherwise false. @Dolinho Make sure you only send the message to the correct player. Which you can set up in the outputChatBox function.
-
dirty hax? It is just a simple overwrite using lua, if you know a little bit lua this isn't a big deal.
-
Resources: Everything else about resources.
-
setElementModel isn't in the code you posted, pls get serious or I will stop helping you.
-
How did you set-up your triggerServerEvent(??????) ?
-
setplayerteam(source,team) setPlayerTeam(source,team) cancelEvent cancelEvent() Even so, cancelEvent has no function in this set-up.
-
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
-
https://wiki.multitheftauto.com/wiki/GetAccount https://wiki.multitheftauto.com/wiki/Ge ... tsBySerial
-
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!
-
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)
-
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)
-
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"
-
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.
-
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.
-
Show updated code.
-
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.
-
Both ways are correct, since the player(the source) you are sending through will become the localPlayer.
-
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)