-
Posts
6,089 -
Joined
-
Last visited
-
Days Won
216
Everything posted by IIYAMA
-
Elementdata you only use on server side will lagg you bandwidth. It will give you more code+time, but it will reduce lots of ping lagg in the future. Since you use bots, it will require double+ of players their internet speed. Add to much Element data and you have teleporting peds. Use instead Tables: local botsTable[bot] = {} local botsTable[bot]["bot.animation"] = true -- or anim etc. if botsTable[bot]["bot.animation"] then local anim = botsTable[bot]["bot.animation"] end -- you can also put it in "array"(mta does have a kind of array, but it also not array) when you need it. table.insert (botsTable,bot) --or local i = 1 botsTable[i]=bot -- i = index 1,2,3,4,5 --[[NOTE:]] botsTable[#botsTable+1] = bot --[[]] table.insert(botsTable,bot) botsTable[i]["bot.animation"]= "lol" for i, bot in ipairs(botsTable) do -- botsTable[i] = bot if isElement(bot) and thisBot == bot then outputChatBox(botsTable[i]["bot.animation"]) botsTable[i]["bot.animation"]= "new lol" end end -- clear elements when they got destroyed, don't loop while to much. While can crash your server when your code might be incorrect. for i, bot in ipairs(botsTable) do while botsTable[i] and not isElement(bot) do table.remove (botsTable, i) end end
-
Not very clear: if isObjectInACLGroup("user." ..accountname, aclGetGroup("Admin")) then outputDebugString ("Admin") elseif isObjectInACLGroup("user." ..accountname, aclGetGroup("SuperModerator")) then outputDebugString ("SuperModerator") end elseif is for spilt the admin from the supermoderator and will only be checked when the if isn't true. It is faster than if end/if end/if end.* if admin then -- check elseif mod then -- check only when if is false. else -- only when if and elseif are false. (false when not true or not exist>elseif) end You can also write it down in a table when they are with more then 4/5 for efficiently. I don't know what is faster, ipairs or elseif. It probably depends on the amount of data. I prever ipairs, because it reduce the lines. local accountname = getAccountName(getPlayerAccount(thePlayer)) for i, type in ipairs({"Admins","SuperModerator"}) do if isObjectInACLGroup("user." ..accountname, aclGetGroup(type)) then end end
-
https://wiki.multitheftauto.com/wiki/RemoveEventHandler
-
anytime. If you need help with install this you can also pm me. Or you I can help you in game.
-
Because it is: "sawed-off", not "Sawned-Off". See weapon property https://wiki.multitheftauto.com/wiki/SetWeaponProperty grenade teargas molotov colt 45 silenced deagle shotgun sawed-off combat shotgun uzi mp5 ak-47 m4 tec-9 rifle sniper rocket launcher rocket launcher hs flamethrower minigun satchel bomb spraycan fire extinguisher camera It it probably a typo on the wiki site, because at the real wiki you also write it like this: http://en.wikipedia.org/wiki/Sawed-off_shotgun
-
Maybe it is handy to read first the syntax. setWeaponProperty (24,"pro","weapon_range", 150) setWeaponProperty (31,"pro","weapon_range", 300) Btw: stay with your members from my forum, I don't want them here. It is my property for god sake!
-
Het is gewoon lastig om in een open source scripts te verkopen.
-
Ik zou eerst ff door leren. Scripts verkoop je niet zo snel, een gehele gamemode zou misschien 15/20 euro maximaal kunnen kosten. Met meer dan 1000 regels code. Dat is het probleem met open source, er zijn heel veel mirrors van scripts. Die zijn meestal zo te downloaden en 8 van de 10 is niet eens ge- decode. Signature Dat probleem had ik nou ook.
-
hmm, (I never used it before on vehicles and did not notice that) setElementAlpha ( vehicle,0) -- onClientRender. local vehicle = getPedOccupiedVehicle (localPlayer) -- not needed, when you already have a vehicle if vehicle then local Sx,Sy,Sz = getElementPosition (vehicle) local _,_, pR = getElementRotation (localPlayer) pR = ((pR+90) * 3.141592653 * 2)/360; --edit "90" to change the rotation. local lookAtX, lookAtY, lookAtZ = Sx + math.cos(pR)*5, Sy + math.sin(pR)*5, Sz setCameraMatrix (Sx,Sy,Sz+4, lookAtX, lookAtY, lookAtZ+4)-- +4 high camera end -- updated and tested
-
or just very basic: SetCameraTarget https://wiki.multitheftauto.com/wiki/SetCameraTarget https://wiki.multitheftauto.com/wiki/GetCameraTarget
-
Well you still doing something wrong and you declare that nothing is wrong.... What do you expect me to do?
-
Why don't you edit the music file name?
-
I updated the sample a little bit.
-
Well you care using, hsm.mp3 in the script. Since your "music.mp3" --> isn't there..... You are seriously confusing me!!! COME TO THE POINT!
-
It is not like a real timer, your onClientRender is your timer. getTickCount() is just a value you can use. Every time your pc creates a render value, it request the join machine time. This is a Sample with frames, not tickCount. But tickCount is preciser in scripting. local startFrame = 0 local frame = 0 frame = frame + 1 if frame-startFrame > 3 then --no 1 - 0 = 1 startFrame = frame end outputChatBox(frame) --1 --------- frame = frame + 1 if frame-startFrame > 3 then -- no 2 - 0 = 2 startFrame = frame end outputChatBox(frame) --2 --------- frame = frame + 1 if frame-startFrame > 3 then -- no 3 - 0 = 3 startFrame = frame end outputChatBox(frame) --3 --------- frame = frame + 1 if frame-startFrame > 3 then -- yes!!!!!! 4 - 0 = 4 startFrame = frame -- STARTFRAME GET FINAL HIS NEW VALUE !!!! "4" end outputChatBox(frame) --4 --------- and now: frame = frame + 1 if frame-startFrame > 3 then -- no the som is now: 5 - 4 = -1 is -1 higher than 3? startFrame = frame end outputChatBox(frame .. " " .. startFrame) --5 4 ---------
-
You talking about tick-count from a both? --running: if getTickCount() - lastTickCount > 300/getGameSpeed() then --not Running: if getTickCount() - lastTickCount < 300/getGameSpeed() then --or if not getTickCount() - lastTickCount > 300/getGameSpeed() then or just an ordinary timer? Normal timer, if the Timer ends it will be gone. isTimer()
-
made a mistake, updated. 300 milliseconds It means it can only executed every 300 milliseconds.
-
timers lagg... https://wiki.multitheftauto.com/wiki/GetTickCount local lastTickCount = 0 addEventHandler ( "onClientRender", root, function () if getTickCount() - lastTickCount > 300/getGameSpeed() then --Divided by gamespeed to reduce bugs. lastTickCount = getTickCount() end end end)
-
Make sure the file is also there.
-
getElementPosition = middle of the ped (0) The distances from the body (middle of the ped) is circa 0.6. (depends how long this ped is) The lines starts 1.4 a both the head of the ped.
-
Well then there isn't anything wrong with the source...... Go to your server, login as admin, write /debugscript 3, start the map. and tell me why it doesn't start. If you can't tell me what went wrong, I can't help you.
-
any errors? /debugscript 3 Did the script even started? outputChatBox("started!") -- outside of the functions.
-
Post your meta + lua file.
-
I don't think they are functional in .lua . But I also don't think they will cause lagg or increase speed.
