Simi23
Members-
Posts
49 -
Joined
-
Last visited
-
Days Won
2
Everything posted by Simi23
-
local playerCoins = tostring(getElementData(getLocalPlayer(), "moneycoins")) or tostring(0) Maybe this will do it
-
Try this: addEventHandler("onPlayerLogin", root, function() local acc = getPlayerAccount(source) local coin = getAccountData(acc, "coins") or 0 setElementData(source, "moneycoins", tonumber(coin)) end) addEventHandler("onPlayerQuit", root, function() local acc = getPlayerAccount(source) local coin = getElementData(source, "moneycoins") or 0 setAccountData(acc, "coins", tonumber(coin)) end) addEventHandler("onResourceStart", resourceRoot, function() for _, player in pairs(getElementsByType("player")) do local acc = getPlayerAccount(source) local coin = getAccountData(acc, "coins") if coin then setElementData(player, "moneycoins", tonumber(coin)) end end end)
-
because this function does not exist. Try this: addEventHandler("onPlayerLogin", root, function() local coin = getAccountData(source, "coins") or 0 setElementData(source, "moneycoins", tonumber(coin)) end) addEventHandler("onPlayerQuit", root, function() local coin = getElementData(source, "moneycoins") or 0 setAccountData(source, "coins", tonumber(coin)) end) addEventHandler("onResourceStart", resourceRoot, function() for _, player in pairs(getElementsByType("player")) do local coin = getAccountData(player, "coins") if coin then setElementData(player, "moneycoins", tonumber(coin)) end end end)
-
Thanks! It works fine! btw the script is not written by me
-
For example, this is for alpha: setModelHandling(602, "mass", 1500) setModelHandling(602, "turnMass", 3400) setModelHandling(602, "dragCoeff", 2.0) setModelHandling(602, "centerOfMass", { 0.0, 0.1, -0.2}) setModelHandling(602, "percentSubmerged", 85) setModelHandling(602, "tractionMultiplier", 0.9) setModelHandling(602, "tractionLoss", 1.8) setModelHandling(602, "tractionBias", 0.5) setModelHandling(602, "numberOfGears", 5) setModelHandling(602, "maxVelocity", 515) setModelHandling(602, "engineAcceleration", 39.5) setModelHandling(602, "engineInertia", 10) setModelHandling(602, "driveType", "4") setModelHandling(602, "engineType", "petrol") setModelHandling(602, "brakeDeceleration", 16) setModelHandling(602, "brakeBias", 0.55) setModelHandling(602, "ABS", false) setModelHandling(602, "steeringLock", 40.0) setModelHandling(602, "suspensionForceLevel", 1.2) setModelHandling(602, "suspensionDamping", 0.8) setModelHandling(602, "suspensionHighSpeedDamping", 0.0) setModelHandling(602, "suspensionUpperLimit", 0.3) setModelHandling(602, "suspensionLowerLimit", -0.15) setModelHandling(602, "suspensionFrontRearBias", 0.5) setModelHandling(602, "suspensionAntiDiveMultiplier", 0.4) setModelHandling(602, "seatOffsetDistance", 0.25) setModelHandling(602, "collisionDamageMultiplier", 0.5) setModelHandling(602, "monetary", 35000) setModelHandling(602, "modelFlags", 4) setModelHandling(602, "handlingFlags", 2) setModelHandling(602, "headLight", 1) setModelHandling(602, "tailLight", 1) setModelHandling(602, "animGroup", 0) And at the line that changes the driveType, it gives the error that i said.
-
Hello! I have a server with a handling script, and if i restart the handling script, it always give me an error at all the lines that are setting the driveTypes " Bad argument @ 'setModelHandling' [Expected bool at argument 4, got none.] " Argument 4? Even what that is ? I think setModelHandling has only 3 args. Any ideas? Thanks
-
Hello I have made a custom model. If I load the model in and I am in the area of its engineSetModelLODDistance then my MTA always crashes out. What do I do? I do the modeling and everything with this tutorial:
- 1 reply
-
- custom model
- crash
-
(and 1 more)
Tagged with:
-
Hello! I'm currently working on a 3D Login Panel, and the edges are so rough. What i'm thinking about is there any way to smooth out the edges of the 3d panel?
-
Thank you!
-
Thank you! @LoPollo btw I can use this in MTA too?
-
Thanks in anyways.
-
Hello! Is there any way I can add, not replace vehicles into my MTA server? Thanks, Simi23
-
Thanks, it helped me. There are pizza requests for a pizzaboy work. It's not problem if one of the items not shown.
-
Hi there! There is my code, but it doesn't work good. My goal is to list 5 random strings in the chat but the first in the chat is always "nil". Why? local pizzas = {"Hawaii", "Sonkás", "Sajtos", "Tonhalas", "Négysajtos"} local deliver = {} function starter() local counter = 1 while counter <= 5 do local num = math.random(0,4) counter = counter + 1 table.insert(deliver, tostring(pizzas[num])) end setTimer( function () outputChatBox("Megkaptad a rendelést, most szállítsd le a következő pizzákat: "..tostring(deliver[0])..", "..tostring(deliver[1])..", "..tostring(deliver[2])..", "..tostring(deliver[3])..", "..tostring(deliver[4]).."!") end ,5000,1) end addCommandHandler("deliver", starter)
-
I know, but pickups have no "onPickupLeave" event. I'm think i am gonna use a hidden marker and make the pickup do nothing.
-
What i think is: If i hit the placed collision of the pickup, it shows me the window, and i can press e to receive my armor, deagle, and an M4. But if i hit that pickup, it happens nothing. I think because pickups has no collision.
-
Hello! I have make a duty script, and its doesn't working. Can anyone solve it? Server: addEvent("addArmor", true) function addArmor() setPedArmor(source, 100) end addEventHandler("addArmor", getRootElement(), addArmor) function pdduty(player) local x, y, z = getElementPosition(player) local pickup = createPickup(x + 3, y, z, 3, 1242) colshape = getElementColShape(pickup) addEventHandler("onColShapeHit", colshape, openwindow) addEventHandler("onColShapeLeave", colshape, closewindow) addEventHandler("onPickupUse", pickup, function() cancelEvent() end) end addCommandHandler("pdduty", pdduty) function openwindow(hitElement, matchingDimension) if matchingDimension and getElementType(hitElement) == "player" then triggerClientEvent("openwindow", hitElement) end end function closewindow(hitElement, matchingDimension) if matchingDimension and getElementType(hitElement) == "player" then triggerClientEvent("closewindow", hitElement) end end Client: sx, sy = guiGetScreenSize() addEvent("openwindow", true) function changeDuty() if getElementData(lPlayer, "duty", "0") then lPlayer = getLocalPlayer() givePedWeapon(lPlayer, 24) givePedWeapon(lPlayer, 31, 180) triggerServerEvent("addArmor", getRootElement()) setElementData(lPlayer, "duty", "1") end end function draw() dxDrawRectangle(sx * 0.4, sy * 0.65, sx * 0.2, sy * 1.0, tocolor(0,0,0,150)) dxDrawText("Duty: [E]", sx * 0.45, sy * 0.7) end function openwindow() addEventHandler("onClientRender", getRootElement(), draw) bindKey("e", "down", changeDuty) end addEventHandler("openwindow", getRootElement(), openwindow) addEvent("closewindow", true) function closewindow() removeEventHandler("onClientRender", getRootElement(), draw) unbindKey("e", "down", changeDuty) end addEventHandler("closewindow", getRootElement(), closewindow) The meta doesn't have any problems, for sure.
-
Hello! I have a server and some mods in. Some car mods have working spoiler, but they are only working if I put lines in vehicle.ide . Is it possible to mod vehicle.ide in a server?
