Jump to content

Citizen

Moderators
  • Posts

    1,803
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by Citizen

  1. So there is no files to copy at all ... You obviously have a MySQL database so just connect on it using phpMyAdmin and export the database as a .sql file and import in on the other host's phpMyAdmin. Don't forget to update credentials to make this script work n the other host.
  2. No. Lines 3 to 6 has to be in a function and the addCommandHandler will go under the end keyword of that function. Check this out: https://wiki.multitheftauto.com/wiki/Scr ... troduction
  3. Well didn't see the right answer here so here it is: local lvl = tostring( getElementData( player, "level" ) )
  4. Citizen

    help me

    You probably can use this event: onPlayerCommand And check if the 1st parameter start with register. And check if the arguments the player used with that command will work. And the best idea is to save it with setAccountData under the key "sawIntro" (set the value to 1). When the player logins or register, check if that data is 1 with getAccountData if not then he didn't saw the intro yet.
  5. On the client-side: Start the script by storing the current money in a global variable and create a timer that will call the check function. The check function will get the money again and check if it is the same than the global variable or not. If it's not the same then you just can get the difference between the two values and display it on the screen. Don't forget to update the global variable with the new current money value. On the server-side: Same process but this time use an element data instead a global. Nothing hard for you I guess.
  6. Enfait c'est très simple, si tu regardes la page wiki du getPlayerMoney (et aussi le nom de cette fonction) tu remarqueras qu'elle doit être utilisé sur un joueur et non pas sur le compte de ce joueur. Il faut considérer le compte et le joueur comme deux choses complètement séparés. Et sur la page du wiki de l'event "onPlayerQuit" on peut lire que la source de cet event est l'élément de type "player" (donc un joueur) qui vient de quitter. Il faut aussi considérer source comme une "variable cachée" envoyé dans la fonction à laquelle il est attaché. Donc de façon logique, pour récupérer l'argent du joueur avec getPlayerMoney, on lui donne en paramètre source et non pas playeraccount. Alors ça c'est une astuce en Lua. En gros _ est une "variable poubelle", ça permet de dire ici: "Je m'en fou du 1er paramètre que t'envois à ma fonction, par contre je veux bien le 2ème paramètre" Et le deuxième paramètre est le compte du joueur sur lequel il vient de se loguer. J'espère que c'est plus clair. (PS: Je te demanderai par contre d'éviter les familiarité comme poto, mon ami etc. Tu peux me tutoyer sans aucun soucis, mais je ne suis pas réellement ton pote de développement ou ton pote irl.) Citizen
  7. It means you changed the explorer's settings to uncheck the line: "Hide the extention of known files". By the way, I would suggest you to open it in an image editor and save it again. And ou can also try with another extension too.
  8. Citizen

    HELP

    And check if the player who triggers the onMarkerHit is the player who can see it (use element datas) Also your code will work for only one player at a time. Why Because you are using a global variable on the server-side. Only use tables/element datas to be able to store multiple markers (so multiple players can do it and have their own markers).
  9. Ok so what you want to do is a storage system to put and get weapons in/from it right ? If so, then you will need 2 gridlists in your gui (one to list the player's weapons with 2 columns (Weapon name and Ammos) and another to list the weapons the storage has). It sounds like you only have 1 gridlist, it's possible but only if you don't plan to show the ammount of ammos. You will have to do a function that will return all the weapons (and their ammos if needed). getPedWeapon or getPedWeapons --you can modify the second function to return the ammos as well. getPedTotalAmmo And this is the functions you need to work with gridlists: guiGridListAddRow guiGridListSetItemText getWeaponNameFromID addEventHandler --the event "onClientGUIClick" guiGetSelectedItem guiGridListGetItemText getWeaponIDFromName giveWeapon --You need to use triggerServerEvent, addEvent and addEventHandler to be able to call it from client-side takeWeapon --Same for this one And I guess it's pretty much it.
  10. No, do not add ' to the arguments after VALUES (?,?,? ...) Only in the first parenthesis.
  11. yeah so did you checked azeru's code ? This is for texts but you can easily modify it to make it work with an image: viewtopic.php?f=91&t=65746&p=619388&hilit=dxSetShaderTransform&sid=50a5002b669ef97d724d2848a19d8175#p619388
  12. Yup totally, but in the end, he will finally use my code and add the parameters on the ondie function ( totalAmmo and theKiller ) we (initially Solstice. and then I) told him to get who killed the guy who used /hitme. Your code really helped me and now i made it 100% and added a new ElementData to the amount to store every Amount when player do /hitme amount and i took with your advice and opened wiki and learned ElementData fanction --Finally i want to say thanks bro You are welcome I was about to help you out with your dxDrawText problem, but Solidsnake were faster. There is no need to stay angry at someone who apologized.
  13. So I was totally right, he wants the image to be rotated a bit like if the top of the radar image being drawn was going inside the screen (I mean like the star wars credits at the end).
  14. Try to quote all the columns name like this: ('atual', 'x', 'y', 'z', etc It will make sure sqlite will interpret them as strings and not variables he will try to resolve internally.
  15. Citizen

    mods

    Use LUA nah, lua is fine, he just didn't closed the tag with a ]
  16. Well pretty much everything: 1 - indent your code 2 - Do not use anonymous functions if you are still learning the basics. 3 - source isn't a number and not a function neither. 4 - we need to know what kind of gui element source is (button ? grid list ?) 5 - Also, be sure you did the following tutorials here: https://wiki.multitheftauto.com/wiki/Scr ... troduction and https://wiki.multitheftauto.com/wiki/Int ... ng_the_GUI
  17. Almost yeah. You need to use getAccountName to then use that name in the saving query (onPlayerQuit) and in the loading query too (onPlayerLogin). But there is another problem in your onPlayerLogin: - Data[1] will be the 1st row in the returned table (so the row with all players datas). - Data[1].vida will be the health. local Data = executeSQLQuery("SELECT * FROM SistemaDeDados WHERE atual=?", atualName) setElementHealth(source, Data[1].vida) setElementPosition(source, Data[1].x, Data[1].y, Data[1].z) You can also do this: local Data = executeSQLQuery("SELECT * FROM SistemaDeDados WHERE atual=?",atual) local datas = Data[1] setElementHealth(source, data.vida) setElementPosition(source, datas.x, datas.y, datas.z) Hope it helps.
  18. Yeah I know but isn't the GTA V radar a bit rotated on the 3rd axis ? (I never played it, just saw some videos). But yeah if he just need to rotate/spining on the screen plan, then yeah you are right, the dxDrawImageSection is just fine.
  19. Yup totally, but in the end, he will finally use my code and add the parameters on the ondie function ( totalAmmo and theKiller ) we (initially Solstice. and then I) told him to get who killed the guy who used /hitme.
  20. Citizen

    Help !! :)

    Just to make everything clear: 1 - You wrote your script here asking for something specific about it. 2 - I replied normally with my version of this script with a lot of comments to explain what you did wrong and what were my changes. 3 - You replied this: 4 - Kept my calm and just replied your code was nasty and that I just fixed it. 5 - Instead saying thanks for that you wrote like if my code was 100% useless: 6 - Told you that you were forgetting were your place should be (listening to experienced members advices and learn from them, not to kick them out just because it wasn't the answer you were expecting). 7 - You did some kind of apologies 8 - At this point I forgave you and help you with your initial problem and pointed out another problem we both didn't see at the begining, the moneyAmount couldn't be known in the ondie function and told you how to get it (without a global, because you were already using a global with the blip but doing it with a global will just not work if two players use it. That's why I used an element data.) 9 - You just replied sayin you basicaly won't use an element data and just remove the local keyword (to make it global). So here you want to introduce again the same bug from the blip, but for the moneyAmount. I spent (notes here I didn't use wasted, because I never waste my time if it can make others better) time to help you out and fix the problem with the blip by using an element data instead. I also commented everything I changed and why I used element data. By not reading my comments, not listening to my advices and by doing it your way, it's exactly the same as if you said it explicitly. (Oh yeah and you also created another topic to ask the community how to fix the problem with your blip that I already fixed using element datas) And after all of that you dare tell me to "try to talk a better way or stfu" and I also guess in that post that you did nothing wrong and that it's all my fault ?! Ok then, it's all my fault, you are right. I'll just stfu because everything I said untill now was just useless, lies and wrong at the same time. (All the things you need to actually make this script work without bug are in the posts above) Bye.
  21. This might help you: viewtopic.php?f=91&t=65746&p=619388&hilit=dxSetShaderTransform&sid=50a5002b669ef97d724d2848a19d8175#p619388
  22. Citizen

    Help !! :)

    rofl And then you will create another topic on this forum asking this: So stop thinking you are smarter that me and I'm just a noob. Pretty much all the advices/solutions I gave so far are clean and bugfree (anyone here to say I don't ?!). So when I say you to use an element data, then use that damned elemrnt data. I won't repeat again, and I won't help you anymore if you just don't give a sh*t about what I can say. Thought you understood since my last post, but you still didn't ...
  23. Hahaha you are cute Do you really think you are good enough to say what will really do my script without testing it ? By saying that, you just prove another time that you don't understand that much. 1 - Use my code and test it. It will work and fix your problem. 2 - Please read the wiki and learn (specially about element datas).
×
×
  • Create New...