-
Posts
6,097 -
Joined
-
Last visited
-
Days Won
218
Everything posted by IIYAMA
-
I mean add this in your code so scripters can help you more. Because I am not going to read your whole script. I have other things to do. 1 add outputDeBugString in your script. Like this: function myfunction outputDebugString ("myfunction got started") end 2 : login as admin 3 : write /debugscript 3 and see how far your script goes, etc.
-
use: outputDeBugString ("till here"), in your code. so you can see with /debugscript 3 what went wrong.
-
I had something else on my mind. Well maybe it is handy to use one timer to update some non important stats. Save it within the tables and update the database when the timer get executed. Tables are still in the memory they can easy and fast be changed, but a database write directly/indirect on the hard drives.(as far I know) Unload the tables after you store the data. Of course there can be a risk when the power falls off or crash. (with in this second) Make sure you script will store the data after the resource stops. It is just how I would do it. Probably some people are against it. Only slow data.
-
and try out getTickCount() --Script can only executed every 1 second (tickcount is in milliseconds) local lastControlFire = 0 function myFunction () if 1000 - (getTickCount()-lastControlFire) < 0 then lastControlFire = getTickCount() end end Nice for add to gui buttons, or something that works on onClientRender or onClientPreRender. (No timers needed your onClientRender is your timer and will take real time, does not matter how much fps lagg you got. It will always be circa 1 second.)
-
return or remove the event. or post your script......
-
omfg server side. selling = createMarker (getElementPosition ( source ) , "Cylinder", 4.0, 255, 0, 0, 255 ) UPDATED
-
selling = createMarker ( x, y, z [, "Cylinder", 4.0, 255, 0, 0, 255 ] ) must be: selling = createMarker ( x, y, z, "Cylinder", 4.0, 255, 0, 0, 255 ) He forgot to remove the " [] " from the wiki.
-
Is this possible? setVehicleEngineState(vehicle, not state) ? function toggleEngine(source) local vehicle = getPedOccupiedVehicle(source) if vehicle then if getVehicleEngineState(vehicle) then setVehicleEngineState(vehicle, false) else setVehicleEngineState(vehicle, true) end end end addCommandHandler( "engine", toggleEngine )
-
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.
