-
Posts
6,097 -
Joined
-
Last visited
-
Days Won
218
Everything posted by IIYAMA
-
Current wep bullet sync will be active when you hold a weapon. (only weapons that create bullets) + the bullet sync setting: >bullet_sync< must be active. (which is by default active) https://wiki.multitheftauto.com/wiki/SetServerConfigSetting Which gamemode are you running? (If tactics, lagg shots are included)
-
local oldDirection addEventHandler("onClientPreRender", root, function () local direction = getControlState ("left") and "left" or getControlState ("right") and "right" if direction then if oldDirection and direction ~= oldDirection then local x,y,z = getElementPosition(localPlayer) setElementPosition(localPlayer, x, y, z) end oldDirection = direction else oldDirection = nil end end) Quick and untested prototype. As well as my last one, iterate it yourself.
-
What about setting the player his position when switching over to another direction?
-
Samp sliding looks like a . It is probably something build in to improve the syncs. Maybe it is included in a glitch: (not sure) https://wiki.multitheftauto.com/wiki/SetGlitchEnabled
-
Most simple method: if getTickCount() % 50 > 25 then end
-
If you are talking about a dx chat, then yes.
-
Your condition: https://wiki.multitheftauto.com/wiki/GetKeyState
-
You can take over the controls of the driver. But the driver remains to be the syncer of the vehicle. Which means that the delay of the action depends on the driver and co-driver their internet speed. https://wiki.multitheftauto.com/wiki/SetControlState https://wiki.multitheftauto.com/wiki/BindKey (serverside)
-
map = { size = 1024 } function reCalculateToMap (posX, posY) return posX / map["size"] * 6000 - 3000, posY / map["size"] * -6000 + 3000 end local x, y = reCalculateToMap (500, 800) print(x, y) function reCalculateFromMap (mapX, mapY) return (mapX + 3000) * map["size"] / 6000, (mapY - 3000) * map["size"] / -6000 end local x2, y2 = reCalculateFromMap (x, y) print(x2, y2) This is just old school math. Example: Click X position in image is: 240px Image size is: 1024px Map size is: 6000 X 240 / 1024 = 0.234375 --[[ 0.234375 * 100 = 23.4 240 is 23.4% from 1024 ]] 0.234375 * 6000 = 1406.25 --[[ Append to other value ETC. ]]
-
local mapX = clickX / map["size"] * 6000 - 3000 local mapY = clickY / map["size"] * -6000 + 3000 Try this. Afaik the left + bottom is -3000, -3000. The right + top is 3000, 3000. And the center is 0, 0.
-
if aX > (x / 2 - map["size"] / 2) and aX < (x / 2 + map["size"] / 2) and aY > (y / 2 - map["size"] / 2) and aY < (y / 2 + map["size"] / 2) then end local clickX = aX - (x / 2 - map["size"] / 2) local clickY = aY - (y / 2 - map["size"] / 2) local mapX = clickX / map["size"] * 6000 local mapY = clickY / map["size"] * 6000 Everything is untested.
-
https://wiki.multitheftauto.com/wiki/OnClientClick string button, string state, int absoluteX, int absoluteY, float worldX, float worldY, float worldZ, element clickedWorld float worldX, float worldY, float worldZ, element clickedWorld https://wiki.multitheftauto.com/wiki/GetScreenFromWorldPosition float float getScreenFromWorldPosition ( float x, float y, float z, [ float edgeTolerance=0, bool relative=true ] )
-
local serial = getPlayerSerial( source ) local accounts = getAccountsBySerial( serial ) if accounts and #accounts > 1 then outputChatBox("You have an account and your data will now be transferred to the new one.", source, 50, 255, 200) local dataSafe = {} --Empty table to save data for i=1, #accounts do local account = accounts[i] local allAccountData = getAllAccountData( account ) local accountName = getAccountName(account) for key, value in pairs ( allAccountData ) do dataSafe[#dataSafe + 1] = {accountName, key, value} end end for i=1, #dataSafe do --Outside my for to cycle through accounts is where I will merge data, for now it prints the table local name, k, v = dataSafe[i][1],dataSafe[i][2],dataSafe[i][3] --So it does index them, BUT, it indexes as nil... outputChatBox(tostring(name)..""..tostring(k)..""..tostring(v), source) --As you can see when it prints end end There is also this function: (if you are interested in moving/replace data. Never used it, so I do not know how it will merge) https://wiki.multitheftauto.com/wiki/CopyAccountData
-
Might help, might not. https://wiki.multitheftauto.com/wiki/SetHelicopterRotorSpeed https://wiki.multitheftauto.com/wiki/SetAircraftMaxVelocity https://wiki.multitheftauto.com/wiki/SetElementVelocity
-
Lol, seems like you had too many rage-quit's. Well, you can use the /disconnect command to access it.
-
Order matters: (the computer reads from top to bottom) triggerServerEvent("PonerCortina", resourceRoot, paintjobID, color) --This does not work local color = "nada" local color = "nada" triggerServerEvent("PonerCortina", resourceRoot, paintjobID, color) You still didn't fix this: - local vehicle = getPedOccupiedVehicle( source ) local vehicle = getPedOccupiedVehicle( client ) It is client, not source. If it doesn't work, then manually debug it...(tutorial) Because I do not know where I have to look for issues.
-
local color = "red" triggerServerEvent("PonerCortina", resourceRoot, paintjobID, color) function Cortina1(paintjobID, color) local player = client -- ... triggerClientEvent (root, "setShader", resourceRoot, paintjobID, color) end addEvent("PonerCortina", true) addEventHandler("PonerCortina", resourceRoot, Cortina1) ? function addPaintjob2(paintjobID, color) outputChatBox("the color is:" .. color) if color == "red" then -- set the red shader elseif color == "blue" then -- set the blue shader ETC. end end addEvent( "setShader", true ) addEventHandler( "setShader", resourceRoot, addPaintjob2 ) I just send the string "red" from clientside to serverside. And from serverside back to clientside for all players. If the string is "red" then set your red shader. Same goes for the color blue. (But you can't pass textures)
-
If you do not know lua, then this is not what you should be learning. Start with lua. And just to be clear, we are not here to donating code to charity Alonemta... so stop begging, it is really a shameful and abusive matter.
-
Your code?
-
@HairyMeets function keyDetection (key, keyState) iprint("key:", key, ", keystate:", keyState) end bindKey ( "arrow_u", "down", keyDetection ) bindKey ( "arrow_d", "down", keyDetection ) Untested, but should activate a single function with the keys arrow UP and DOWN. (clientside)
-
Code is already there in example, blind chicken...
- 5 replies
-
- 2
-
-
- blokker_1999
- ccw
- (and 12 more)
-
See example of this page: https://wiki.multitheftauto.com/wiki/SetPedCanBeKnockedOffBike
- 5 replies
-
- blokker_1999
- ccw
- (and 12 more)
