Scripting Moderators
  • Content Count

  • Joined

  • Last visited

  • Days Won


IIYAMA last won the day on July 28

IIYAMA had the most liked content!

Community Reputation

1,088 MTA Ambassador


  • Rank
    Scripting Moderator & User Guide Contributor
  • Birthday 01/01/2016


  • Gang
  • Location
  • Occupation
    I have never been to the streets of SA... so who knows?
  • Interests
    Design, scripting, UX/UI

Recent Profile Visitors

10,895 profile views
  1. local nextCommandTime = {} -- function () local key = getPlayerSerial(player) -- serial based -- or local key = player -- element based local timeNow = getTickCount() if timeNow > (nextCommandTime[key] or 0) then nextCommandTime[key] = timeNow + 10000 else -- You will have to wait! end -- end By comparing current operating time with a fixed operating time + future offset, can be used to limit executions. ACL Manually: - Shut down the server (important) Disable commands in ACL: (add to the group: <acl name="Default">) <right name="command.fabricar" access="false" /> Enable commands in ACL: (add to the group you want to have access to this command) <right name="command.fabricar" access="true" /> - Save file - Start the server Or use admin panel to add those rights.
  2. You can only cancel the server variant. onClientVehicleStartExit If the wiki doesn't indicates that it can be cancelled, then you can't cancel it.
  3. local user = dbPoll(qh,500) "=" was missing. And you might also want wait for it a little bit longer, maybe your database is slow. local user = dbPoll(qh, -1) "SELECT * FROM accounts WHERE username=?" Add a limit to speed up your queries: "SELECT * FROM accounts WHERE username=? LIMIT 1" Or your username is incorrect. iprint("username", un)
  4. hmmm, not sure. Maybe your timing is mismatched? setTimer(function () local mysqlResource = getResourceFromName ( "mysql" ) if getResourceState(mysqlResource) == "running" then local con = call ( mysqlResource, "getConnection") iprint("connection", con) else iprint("running state", getResourceState(mysqlResource)) end end, 1000, 1) This is how I handle MySQL failures: function connectMysql() con = dbConnect( "mysql", "dbname="..dbname..";host="..host..";charset=utf8", username, password, "share=1" ); if (con) then outputChatBox("#FFFFFFMySQL connection#00AA00 successful#FFFFFF!", root, 0, 0, 0, true); return true end return false end addEventHandler("onResourceStart", resourceRoot, function () if not connectMysql() then cancelEvent (true, "Can't connect to MySQL server" ) end end)
  5. @RogerPizarro Moved to here: https://forum.mtasa.com/forum/167-scripting/


    Search on this page with the word: color And you will find what you are looking for per element.


    Yes, you forgot to explain that... But it wasn't that hard to figure that one out. I answered your question for the most part. You also need to enable propagation: addEventHandler('onDgsMouseClick', getResourceRootElement( getThisResource( ) ), onClickSuicide, true) Not sure why you did change that setting without knowing what it is for. addEventHandler('onDgsMouseClick', getResourceRootElement( getThisResource( ) ), onClickSuicide, true) And even better, attach the event to your button element: addEventHandler('onDgsMouseClick', Olme, onClickSuicide)


    You can't use killPed on a player clientside. Only serverside. Read the docs: https://wiki.multitheftauto.com/wiki/KillPed Instead (or kill the player serverside, which I would recommend you to do -> prevent strange animation bugs): setElementHealth(localPlayer, 0)

    Lua f*k sh*t

    No need to bring this not useful 'Lua is :~'(users are :~) topic up from 2 years ago. LOCKED
  10. @erisP You might want to reply at least (, even if you are not going to do anything with it).
  11. @erisP Use the (dynamic) element tree. -- server local colshapeParent = createElement("colshapeParent", "blockColshapeParent") local BlockVehicle = createColCuboid ( 1573.84900,-1637.5,12, 10,6,6 ) setElementParent(BlockVehicle, colshapeParent) local BlockVehicle2 = createColCuboid ( 1573.84900,-1637.5,12, 20,6,6 ) setElementParent(BlockVehicle2, colshapeParent) -- client --[[ -- clientside colshapes do local colshapeParent = getElementByID("blockColshapeParent") if colshapeParent then local BlockVehicle2 = createColCuboid ( 1573.84900,-1637.5,12, 20,6,6 ) setElementParent(BlockVehicle2, colshapeParent) end end ]] function isInColExport () local colshapeParent = getElementByID("blockColshapeParent") if colshapeParent then local colshapes = getElementChildren(colshapeParent) for i=1, #colshapes do local colshape = colshapes[i] if isElementWithinColShape(localPlayer, colshape) then return true end end end return false end Untested. Colshapes must be created in the same resource as the parent, clientside/serverside doesn't matter.
  12. You could try also something like this: https://community.multitheftauto.com/index.php?p=resources&s=details&id=13991 It is probably not what you are looking for, but it might be interesting to look at.
  13. Afaik you can only disable them, which means that you can re-enable them when you are even higher.
  14. most likely
  15. Do you mean that it is inaccurate in some way? Or do you mean that you want to add spread, but that doesn't work out great? @redditing + You have to keep in mind that bullets created by a default weapon do have a different start point. They are NOT created from the weapon muzzle, but from target start. That means that if you set the target of the custom weapon to the target end position, the lines between the two weapons will cross at this point, instead of stay next to each other to the infinity-end position. So maybe try this instead: https://wiki.multitheftauto.com/wiki/GetPedTargetCollision