Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


Citizen last won the day on November 25 2020

Citizen had the most liked content!


About Citizen

  • Birthday 12/07/1993

Member Title

  • Global Moderator


  • Gang
    Byston Evolution
  • Location
    Lyon ( France )
  • Interests
    Lua,C/C++,HTML,PHP, mySQL,Basic,C#,JAVA,js and MTA of Course ^^

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Citizen's Achievements


Loc (38/54)



  1. Hello @MTA.Castiel, The Tutorials section is only for posting tutorials. Your post is a scripting question so I'm moving it into the right section. Also please edit your post so that your Lua code is wrapped into a code block so that it's easier for people to read it: Thank you for your understanding.
  2. Hello and welcome, Don't ask your scripting questions in Tutorials please. I have moved it to the portuguese scripting section.
  3. Hello and welcome. This is not a tutorial and you are writing in portuguese so I have moved your post to https://forum.mtasa.com/forum/127-programação-em-lua/ Please keep the tutorial section for tutorials only. Thank you for your understanding.
  4. Hello @Duff1995, I moved your post in https://forum.mtasa.com/forum/127-programação-em-lua/. Please post in this section for your next scripting questions. Best regards, Citizen
  5. Citizen

    mta server list bug

    I don't know how still valid this list is but that's what I've found: Untill someone who knows the list replies. But I would first use our server port checker: https://nightly.mtasa.com/ports/ And if everything is fine, maybe your new node IP is banned by MTA (either an exact IP ban or an unfortunate IP range ban that include yours).
  6. Yes we did miss you ! Welcome back aboard ! You probably left but your were kinda still there with us as we grew with your popular resources. I think all servers have the bone_attach resource (or had at some point). At least I did grow with your bone_attach with me. When your website went down, it was a big hit for me, trying to find mirrors of it somewhere. But the community is always there to back it up and keep moving forward.
  7. [Moved from Scripting >Tutorials] Hello, Your post doesn't match the requirements to be considered a tutorial and is too short. You do not explain in details how to use it, the code shows bad practices, is not indented and actually has an error because Pdx is not defined. Also you must write the description in english in this category. Thanks for understanding.
  8. @Zango Nope, it will just stop working now (will never open) because the source of onClientMarkerHit is the marker which got hit, not the element hitting the marker. @Patlik You have to check if the hitPlayer (provided as 1st parameter of the handler function) is equal to the localPlayer element (and checking matchingDimenssion is a best practice too): function MKH_OPEN (element, matchingDimension) if element ~= localPlayer or not matchingDimension then return end if not atm[source] then return end if guiGetVisible(GUIEditor.window[1]) then -- I've also removed `== true` there as it is redundant guiSetVisible(GUIEditor.window[1], false) showCursor(false) else guiSetVisible(GUIEditor.window[1], true) showCursor(true) end end addEventHandler("onClientMarkerHit", root, MKH_OPEN)
  9. You have the most optimized way of creating the teams. But this code teams = createTeam is wrong, as you are overriding the teams variable as you are iterating over that list. The 1st one gets created, the second should fail because that teams variable just changed for the team entity you created in the 1st iteration of the loop. You can also write it like this (by using unpack): for k, v in ipairs( teams ) do createTeam( unpack(v) ) -- unpack can be used here because it is in the same order end but it's less optimized (if this is not a time critical code, then it will just save you time writing the code, but not by much either :p)
  10. Use the ipb and/or performancebrowser resource to check the perfs and get insights of what function calls makes your server to lag. Most of the time it is because you have too much calls to setElementData A little page about performancebrowser: https://wiki.multitheftauto.com/wiki/Resource:Performancebrowser
  11. Moved to Scripting section.
  12. Okay alors maintenant, si je te dis de modifier ton code pour essayer ça: else outputChatBox( row["x"] ) -- même résultat avec outputChatBox( row.x ) -- local x, y, z = getElementPosition(source) -- setElementPosition(source, x, y, z) end qu'est-ce qui s'affiche dans la chatbox ?
  13. Mes commentaires/explications dans le code: local qh = dbQuery(db, "SELECT * FROM users WHERE username=?", username) local result = dbPoll (qh, -1) local row = result[1] -- ici tu récupères la row de ta DB if not row then spawnPlayer(source, 1743.63281, -1861.50757, 13.57743) local x, y, z = getElementPosition(source) dbExec(db, 'INSERT INTO users (username, posX, posY, posZ) VALUES (?,?,?,?)', username, x, y, z) else -- ici t'as confirmation que "row" existe mais tu ne fais rien avec, il faut récupérer les valeurs x, y, z depuis la row ! local x, y, z = getElementPosition(source) -- et non pas getElementPosition qui va récupérer la position actuelle du joueur, cad 0, 0, 0 par défaut quand on se connecte setElementPosition(source, x, y, z) -- et il faut utiliser spawnPlayer plutôt que setElementPosition si t'as pas déjà spawn end
  14. C'est pourtant ce que tu as laissé sous-entendre en le présentant comme ton nouveau système d'inventaire ? J'ai déjà croisé pas mal de personnes de mauvaise fois mais là c'est quand même pas mal. Surtout que tu as report mon 1er message et une partie des admins/modo l'ont vu et envers lesquels j'ai dû me justifier. Pas longtemps cela dit car il était évident que j'avais vu juste. Ne vient pas te plaindre maintenant que tout le monde semble être contre toi. Tu as essayé de nous la mettre à l'envers et peut être tenté de gagner de la reconnaissance en tant que scripter. Tu ne sembles même pas être désolé et tu restes sur la défensive en essayant de nous faire croire que c'est nous qui avons mal interprété tes dires. Donc tu peux t'estimer heureux de t'en tirer sans même un warning (jusqu'à maintenant du moins ?)
  • Create New...