Jump to content

Citizen

Moderators
  • Posts

    1,803
  • Joined

  • Last visited

  • Days Won

    8

Citizen last won the day on June 13 2022

Citizen had the most liked content!

6 Followers

About Citizen

  • Birthday 12/07/1993

Member Title

  • Global Moderator

Details

  • 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

Jacker

Jacker (39/54)

55

Reputation

  1. <""servername>Default MTA Server</<"servername"> Should be <servername>Default MTA Server</servername>
  2. Hello @BigBoss1234, Don't use the Tutorial section to ask scripting questions. Your topic has been moved to the Scripting section and approved so other members can now see it. Using the right section for your post next time will reduce the waiting time for an actual answer. PS: Also embed your lua code in a script block so it is easier to read. It's greatly appreciated in the community when OP does so (I edited your post for you) Best regards,
  3. Citizen

    Client problem

    You have a service named "cFosSpeed System Service" running. Disable it.
  4. Hello @Wananazo, Your topic is not a tutorial so it has been moved to the Scripting Section. Tutorials section is only meant for tutorials. Make sure to post your next topic to this section when asking for help with scripts. Also make sure to paste code in code blocks (I edited your post to fix that) Best regards,
  5. @Mr.Hugin sendDiscordMessage doesn't exist (rename the function at line 3 from msg to sendDiscordMessage)
  6. Hello, I moved your topic to the Scripting section. The Tutorials section is only for Scripting Tutorials, for scripting questions, use the Scripting section instead. Make sure to use this section for your next scripting questions. I also edited your code to hide your discord webhook id and secret, never share it or someone else can send message to the targeted discord channel.
  7. @Shady1Il n'est pas en train de demander de l'aide pour créer un système spécifique, il cherche à monter une équipe pour créer un serveur roleplay et il recherche donc des personnes pour scripter et mapper son serveur. @Kratos_26000Bienvenue sur le forum et bonne chance pour ta recherche. Pour être transparent, il n'y a pas beaucoup de personnes dans la section FR du forum/discord, et en général ces personnes sont déjà prises sur d'autres projets ou n'ont plus le temps suffisant pour se lancer dans de nouveaux. Mais il y aura toujours des personnes pour te décoincer si tu as des soucis de code ou d'installation de ton serveur (ici ou sur le discord officiel MTA).
  8. Hello @VortDyn, I moved your topic to the Scripting section. The Tutorials section is only for Scripting Tutorials, for scripting questions, use the Scripting section instead. Make sure to use this section for your next scripting questions.
  9. Are you sure you are showing the code where it actually happens ? Because there is no way you can reach the arithmetic operation (+1 or -1) unless ID = true, but table.find can't return true, it can only return false so if ID then should stop the code there. Can you show the exact command you type in chat, and the exact error message please ? (and which line the error occurs at)
  10. - You use getElementData "Map" but where do you setElementData "Map" ? The element data doesn't exist when it is called and you get false instead of the map's name. - Don't escape strings yourself with gsub, use "?" placeholders instead. It will prevents bad things like SQL Injections for you. Example: local playerName = getPlayerName(source) executeSQLQuery("SELECT * FROM players WHERE name=?", playerName) - At line 144 I see you use getElementData "country" and "Country" are you sure about the names ? Why do you have 2 versions of the country data ? Looks like bad practice and looks confusing - [perf] Why do you need to trigger onServerSendRanking AND onServerSendRanking2 ?? They are the exact same calls, just use onServerSendRanking on both client handlers triggerClientEvent(source,"onServerSendRanking",source,ranking) triggerClientEvent(source,"onServerSendRanking2",source,ranking) - [perf] Don't use getElementData for the same data twice where you can call it once: if getElementData(v,"state") and getElementData(v,"state") == "alive" then Do this instead: local state = getElementData(v, "state") if state and state == "alive" then - [bug] Should be `< 10` here on both lines because you want that "8" or "9" turns into "08" or "09" respectively - Don't use reserved keywords for your variable names. Here table is a reserved keyword:
  11. I think you removed a lot of the actual code but your loop should work if you fix the typo here (everything you did is case sensitive already): for _, p in pairs(getElementsByType("player")) do -- "player" not "Player" If that's not the issue in your code, then there has to be an error in the logs ? (playerLogged is the server event called from the login GUI form right ?)
  12. Then this should work : triggerServerEvent("kilLDayZPlayer", hitElement, source) For onClientPlayerWeaponFire, source is the player element who fired the weapon, so adding it as the attacker attacker for the kilLDayZPlayer event should do the trick.
  13. Where did you put that code ? can you show more of the script so we can see the context ? if you have the attacker available as a variable, you have to add it in your triggerServerEvent: triggerServerEvent("kilLDayZPlayer", hitElement, attacker) -- assuming attacker is the variable that holds the player element who attacked
  14. I don't really understand, do you have a problem with the dxDrawText ? Can you take a screenshot and show us what the problem is please ? I just want to point out that it looks like you want to make a password field. For this, you should use guiCreateEdit instead (there is also a method for edit to not show the password when writing in it: guiEditSetMasked). Memo are for multiline texts. But anyway, it won't fix your problem. Your problem is that you are giving a relative size (width and height) that is too small for it to work on small screen: 0.10 and 0.03 - on a 1920x1080 screen: it means 0.10 x 1920 = 192 pixels(px) of width (that's okay) and 0.03 x 1080 = 32.4px of height which is okay too, but - on a 1280×720 screen: it means 0.10 x 1280 = 128px width but 0.03 x 720 = 21.6px of height which is not okay because it's too small. Memo or Edit have some inner margin that you can't override so the text doesn't have enough space to show. To fix that one quick solution you can try is to make sure the height doesn't go under a minimum height by using math.max : guiCreateMemo(0.45*screenW, 0.42*screenH, 0.10*screenW, math.max(0.03*screenH, 30), "", false) -- back to false (absolute) I put 30 px as minimum but you can change it a bit (I don't know what the real minimum is for the text to show properly). NOTE: If it is part of a window (guiCreateWindow) then you have to instead to make it relative to the window (and not the entire screen) by setting the gui window as its parent: local window = guiCreateWindow(0.36, 0.27, 0.35, 0.34,"GUI Window", true) guiCreateMemo(0.45, 0.42, 0.10, 0.03, "", true, window) -- you have to rework the values here For more understanding, please consider reading this guide: https://wiki.multitheftauto.com/wiki/Introduction_to_Scripting_the_GUI
×
×
  • Create New...