-
Posts
6,063 -
Joined
-
Last visited
-
Days Won
208
Everything posted by IIYAMA
-
if #getVehicleOccupants (source ) == 0 then ?
-
https://wiki.multitheftauto.com/wiki/Ge ... actElement When a player is at the roof/(or what ever) of a vehicle.
-
Take a close look to this page and don't define playerSource as the (dead)player his last ammo -_-" LUA:5 https://wiki.multitheftauto.com/wiki/OnPlayerWasted The killer can also be nil. LUA:17 if killer then You can take more of my time if you solve at least those problems.
-
@CastielRecords Maybe you should find the definition of 'bro', because I am not even close your "bro". I am relaxed, telling me that I should relax will cause the opposite. I will not visiting this subtopic any more, post anything after this towards me would be useless.
-
myTable = {} myTable[player] = {}
-
function win(ammo, killer, weapon, bodypart) if (killer and getElementType(killer) == "player" and killer ~= source) then local H = getElementData(killer, "XP") or 0 --local S = getElementData(killer, "Level") local killer1 = getPlayerName(killer) local noob = getPlayerName(source) local X = math.random(5, 70) setElementData(killer, "XP", tonumber(H)+X) local H = tonumber(H) + X if tonumber(H) <= 100 then setElementData(killer, "Level", "Lvl 0") elseif tonumber(H) <= 400 then setElementData(killer, "Level", "Lvl 1") elseif tonumber(H) <= 600 then setElementData(killer, "Level", "Lvl 2") elseif tonumber(H) <= 800 then setElementData(killer, "Level", "Lvl 3") elseif tonumber(H) <= 1000 then setElementData(killer, "Level", "Lvl 4") elseif tonumber(H) <= 1200 then setElementData(killer, "Level", "Lvl 5") elseif tonumber(H) <= 1400 then setElementData(killer, "Level", "Lvl 6") elseif tonumber(H) <= 1600 then setElementData(killer, "Level", "Lvl 7") elseif tonumber(H) <= 1800 then setElementData(killer, "Level", "Lvl 8") elseif tonumber(H) <= 2000 then setElementData(killer, "Level", "Lvl 9") elseif tonumber(H) <= 2200 then setElementData(killer, "Level", "Lvl 10") elseif tonumber(H) <= 2400 then setElementData(killer, "Level", "Lvl 11") elseif tonumber(H) <= 2600 then setElementData(killer, "Level", "Lvl 12") elseif tonumber(H) <= 2800 then setElementData(killer, "Level", "Lvl 13") elseif tonumber(H) <= 4000 then setElementData(killer, "Level", "Lvl 14") elseif tonumber(H) <= 4200 then setElementData(killer, "Level", "Lvl 15") elseif tonumber(H) <= 4400 then setElementData(killer, "Level", "Lvl 16") elseif tonumber(H) <= 4600 then setElementData(killer, "Level", "Lvl 17") elseif tonumber(H) <= 4800 then setElementData(killer, "Level", "Lvl 18") elseif tonumber(H) <= 4900 then setElementData(killer, "Level", "Lvl 19") elseif tonumber(H) <= 7000 then setElementData(killer, "Level", "Lvl 20") elseif tonumber(H) <= 9000 then setElementData(killer, "Level", "Lvl 21") elseif tonumber(H) <= 15999 then setElementData(killer, "Level", "Lvl 22") elseif tonumber(H) > 15999 then setElementData(killer, "Level", "Lvl 23") end end end addEventHandler( "onPlayerWasted", getRootElement(), win) function onLogin (_,account) setElementData(source, "Level", getAccountData(account, "LV") or "Lvl 0") setElementData(source, "XP", getAccountData(account, "EXP") or 0) end addEventHandler ("onPlayerLogin", root, onLogin) function saveData(thePlayer, theAccount) --local theAccount = getPlayerAccount(source) -- you already have the account..... fu nonsens ! if (theAccount and not isGuestAccount(theAccount)) then setAccountData (theAccount, "LV", getElementData(thePlayer, "Level") or 0) setAccountData (theAccount, "EXP", getElementData(thePlayer, "XP") or 0) end end addEventHandler ("onPlayerQuit", root, function () saveData(source, getPlayerAccount(source)) end) addEventHandler ("onPlayerLogout", root, function (prev) saveData(source, prev) end) If you say again that it didn't work or bumb again I will start give sarcastic comments on all your fu topics.
-
well I am not going to find all code mistakes... But: testFunction(getElementData(dxElement,"handledFunction")) break instead of: return getElementData(dxElement,"handledFunction")
-
so what? You can't call it a FPS calculator, cause it isn't frames per second.
-
I have also been testing fps counters, it is very usefully to check the amount of time between the frames. Especially when you want to check somebody his lagg's. But onClientRender triggers just the amount of frames and you are using time to calculate this. A normal FPS counter will automatic do math.ceil because it doesn't count half frames. Time isn't a frame, you never will know how many frames have been past in this second. This isn't a Frames Per Second counter, but a Timer Per Frame calculation.
-
you put it serverside?
-
you are returning to a handler function, with that you are also breaking your main loop.
-
addEventHandler("onClientRender",root,moveElement,posX,posY)
-
function moveElement(posX,posY) if (posX > endX) then setElementData(dxElement,"posX",posX - speed) elseif (posX < endX) then setElementData(dxElement,"posX",posX + speed) end if (posY > endY) then setElementData(dxElement,"posX",posY - speed) elseif (posY < endY) then setElementData(dxElement,"posX",posY + speed) end if (posY == endY) and (posX == endX) then removeEventHandler("onClientRender",root,moveElement) end end function dxMoveElement(dxElement,endX,endY,speed) local posX = getElementData(dxElement,"posX") local posY = getElementData(dxElement,"posY") addEventHandler("onClientRender",root,moveElement) end
-
Well I didn't mention that you are a beginner, I asked it because I can't work with shader files, I simply don't see logistic with in .fx It simply doesn't make any sense in my opinion, but it would be great if you can work with it.
-
Why do you need to test with the editor? You can also test it manually, by just start it from admin after you saved it and put the meta back.
-
Well then I will recommend you to make a backup and place it every time the meta back, after saving the map. As far I know you can't disable the overwrite functions from the editor.
-
you sure you are ready for shaders? You can also take a step back and apply your own TXD's and dff if you can make those. https://wiki.multitheftauto.com/wiki/EngineImportTXD https://wiki.multitheftauto.com/wiki/EngineLoadDFF
-
well if you say so, the problem you have now are the global s. local x,y,z = getElementPosition(player) local car = getVehicleModelFromName(car)
-
@reaction because of your pm. Well no you can't prevent that the line will be overwritten if that is your main problem. What I do is making a backup from the meta.xml (create and extra folder for the backups) Then open the map and edit it. When I am finished with that and saved saved the map, I copy the backup meta.xml back in it's place. It is just something that can be solved by spending a little bit more time at administration.
-
Well no, satchel's are sharing same explosion the grenade. But you can try something like this: (this have to be done per player because satchel positions aren't synced) -- client -- addCommandHandler("getallSatchels", function () local projectileTable = getElementsByType ("projectile") local projectileDataTable = {} for i=1, #projectileTable do local projectile = projectileTable[i] if getProjectileType(projectile) == 39 and getProjectileCreator (projectile) == localPlayer then local x,y,z = getElementPosition(projectile) projectileDataTable[#projectileDataTable+1] = {x=x,y=y,z=z} end end if #projectileDataTable >0 then triggerLatentServerEvent(localPlayer,"allSatchel",localPlayer,projectileDataTable) end end) -- server -- addEvent("allSatchel",true) addEventHandler("allSatchel",root, function (projectileDataTable) if isElement(source) then detonateSatchels (source) -- blow the satchels -- local players = getElementsbyType("player") -- get all the players for p=1,#players do -- loop through all the players local pX,pY,Pz = getElementPosition(players[p] for X=1,#projectileDataTable do -- loop through all the satchels per player local satchelPosition = projectileDataTable[X] if getDistanceBetweenPoints3D ( pX,pY,Pz, satchelPosition.x, satchelPosition.y, satchelPosition.z ) < 5 then -- compare the distance end end end end end) @kevenvz, first read, then answer.
-
Print is visible in the server console, but yes better to use output's.
-
If I did payed scripting,(which I am doing not) I would ask 10 euro a hour, it is just normal here....
-
You have to create them, before you can use them. createObject or use the editor*
-
If you can't find it, the short cut key for that is "ctrl + H". (notepad++ or normaly notepad etc.)