Jump to content

Gordon_G

Members
  • Posts

    282
  • Joined

  • Last visited

Everything posted by Gordon_G

  1. A dbPoll return a value like this : { { ["col_name1"] = value, ["col_name2"] = value }, -- row 1 { ["col_name1"] = value, ["col_name2"] = value }, -- row 2 } Etcetera... So in your example, <v> variable is something like : { ["col_name1"] = value, ["col_name2"] = value }, -- row 1 So you may need a second for loop to index the columns and their values in this <v> row
  2. Hi, I highly advise you to take a look to the "bengine" ressource to take a look at how it actually works The main issue is that you have to disable EVERY VEHICLE SOUNDS for EVERY VEHICLES in order to achieve what you are trying to do (and that's how the previously mentionned resource works)
  3. Great work I've personnaly manually updated my bone_attach resource the exact day when the onClientPedsProcessed got realized. I've immediatly seen the difference. Now attached elements are totally synced with the ped movement because when you use onClientRender or onClientPreRender you have a little delay beforce re-positionning the attached obj when the player moves very fast (like aiming).
  4. Solved, TXD has to be replaced first, then DFF
  5. @TheNormalnij This is just a bunch of code I made yesterday https://mega.nz/file/CthTBQzR#nCJpE20HC51un054_B-UF-dgYYBZX_Q3OTeXrx94iWA If you have any question about it feel free to ask
  6. Hi, Here are two vehicles created by script. The grey one is a Virgo that has a replaced model, there is no issue about its textures. The red one is a vehicle created server-sidely as a Virgo. Then its model is replaced client-sidely by a new model wich is requested by engineRequestModel the parentId is 491 (wich is the Virgo's id) As you can see the red vehicle suffers from textures problem and I can't seem to resolve them. I tried to change the parentId but it doesn't help at all. Does anybody know how to solve this ? Is the bug known ? Thanks !
  7. Très bien n'hésite pas, j'essaierai de t'aiguiller ensuite
  8. Salut, Pour commnencer tu as besoin d'une base de donnée (SQL=base de donnée sur un serveur/SQLite=base de donnée locale, dans un fichier), pour l'instant on va partir sur du sqlite. Pour ça tu aura besoin de la fonction dbConnect Tu trouveras par ailleurs sur le wiki toute l'aide dont tu as besoin pour créer ta base de donnée Bien, je ne sais pas si tu sais comment fonctionne une base de donnée mais à vrai dire c'est relativement simple. Une base de donnée est composée de tables qui elles-mêmes contiennent des colonnes. Ensuite, on insère des enregistrements (dont des lignes dans la table). Il faut donc créer une table avec des colonnes pour commencer, il faut donc envoyer une consigne à notre base de donnée pour qu'elle créée une table, on appelle ça une "requête SQL". On placera usuellement la requête créant une table juste après la connexion à la base de donnée (donc sur la ligne suivante dans ton script), pour s'assurer que la table existe avant d'aller y chercher des données, ça semble logique. Sur MTA on utilise la fonction dbExec Je vais te donner ici une structure d'exemple pour créer une table. dbExec( connexionDatabaseRetourneeParDBCONNECT, "CREATE TABLE IF NOT EXISTS NOM_DE_LA_TABLE (colonne1 TEXT, colonne2 NUMERIC, colonne3 TEXT, blablabla TEXT) Donc, qu'est-ce que j'ai fait ici ? J'ai utilisé une fonction, dbExec et j'y ai passé deux arguments. Premièrement l'élement SQL qui correspond à ma base de donnée et qui m'a été retournée par la fonction dbConnect que nous avons vu plus haut. Deuxièmement j'ai passé une chaine de caractère à ma fonction, c'est la requête SQL en elle-même. Dans cette requête SQL je demande à ma base de donnée de CREER une table NOM_DE_LA_TABLE SI ET SEULEMENT SI une table avec ce nom n'existe pas déjà (ça permet d'éviter d'avoir 50 tables avec le même nom). Puis, je place entre parenthèse le nom des différentes colonnes et le type de donnée qu'elles pourront accueillir. Par exemple, dans ma table NOM_DE_LA_TABLE, j'aurai une colonne nommée colonne1 et qui pourra accueillir du texte (donc des données comme : bonjour, le nom d'un joueur, peu importe). Attention à bien choisir le type de donnée que peu stocker ta colonne, effectivement, tu auras des erreurs lorsque tu tenteras d'y stocker quelque chose sinon. Ensuite j'ai crée la colonne colonne2 qui peut accueillir des données numériques (donc des données comme : 5, 6, la position d'un joueur). Bien, je pense que tu as compris la suite. Commence par former un script qui va répondre à tes attentes en te basant ce que je t'ai envoyé (tu devras remplacer le nom de la table, peut-être le nom du fichier sql dans le dbConnect, le nom des colonnes en fonction de tes besoins). Je reviendrai vers toi ensuite pour t'expliquer comment tu pourras aller stocker et chercher des données dans ta base. @FoxSnow
  9. Gordon_G

    Server protection

    I don't know wich setting allowed that, I wasn't the server owner and it's been a long time since then (it in 2016 or earlier so I don't remember pricesely to be honest ^^' )
  10. Gordon_G

    Server protection

    Cheating - if you mean like giving weapons and so on like on other multiplayer mods, it's almost impossible (or well, i dont know how). The only cheat I've already seen is possible walking through walls by removing their collision on their game's files but you can easily counter it by restricting allowed mods in server.conf Theft - This might be the hardest part but here are some sulutions provided by @Dutchman101 Some others here : Hacking - I guess you might talk about a client injecting stuff in their client-side part. The best way to counter this is by ALWAYS verifying server-side when a player request an action, especially when it's an admin action of your gamemode (i don't know, like adding something to you database by a client-side GUI, you would verify server-side if the player is really an administrator) EDIT : About the last part, you should also not use synced elementData. You may know that it's a waste of performance but it also has security issues (because you can read-write it from client so a malicious client could put anything in that elementData)
  11. Actually, you can only replace base gta sa's object with MTA Take a look here https://dev.prineside.com/en/gtasa_samp_model_id/ Let's search for example the 18365 object Here it's a gta sa object, so you can replace it without any issue But for the model 19214 (wich you are currently browsing), here is what it gives us : As you can see, it's an SA-MP model ID so you can't replace it on MTA (in fact, this ID just doesnt exist in MTA)
  12. I understand, thanks for your answer
  13. Hi, Isn't the use of OOP better (i mean, faster) to do this kind of position transformation ?
  14. Could you be more specific ? Do you want the user the enter his discord's name ?
  15. To talk about the original question... The error is solvable easily Look, you've put "local" at the start of the line when you define you function local function getTooltip(name) If you add a "local" to a variable (wich can be a function, a string, an integer...) then you won't be able to access it directly from another file I guess you know what to do now, have a nice day.
  16. i'm not sure to understand but in lua you can declare a local function, is that what you want to do ?
  17. GetAttachedElements doesn't work with the bone_attach resource since the attached objects aren't attached with attachElements
  18. you could store the attached weapon object in an element data (setElementData) then retrieve this element data client-sidely (getElementData) once the player is aiming and hiding the object with setElementAlpha OR you could not use element datas (cause it has a lot of security issues and lacks of performance) and send the object manually to client side (triggerClientEvent)
  19. then pass the estimated cost clientside when you call the client side's gui
  20. I may have a solution. When you attach your ped to an element (like an object) and then destroy that element it turns the light back on the peds (so the bug is solved) However I don't know if it always work, I just noticed that while I was scripting
  21. 1 - Download an image like this one (or make it yourself) https://www.google.fr/search?q=transparent+with+black+vignette&tbm=isch&ved=2ahUKEwjwpvrU96zpAhX6gM4BHcEBC8oQ2-cCegQIABAA&oq=transparent+with+black+vignette&gs_lcp=CgNpbWcQAzoECCMQJzoECAAQQzoCCAA6BAgAEB46BAgAEBM6CAgAEAgQHhATOgYIABAIEB46BggAEAUQHlCcnAZYnbgGYKq5BmgAcAB4AIABQIgB9wiSAQIyMJgBAKABAaoBC2d3cy13aXotaW1n&sclient=img&ei=1Nu5XvDsO_qBur4PwYOs0Aw&bih=631&biw=1366#imgrc=dXC6_MSyTzxFAM 2 - Add it to your resource's meta.xml by adding a line like this one <file src="your name file.extension" /> 3 - Draw it to the player's screen by using script You'll need to retrieve player's screen weight and height in order to draw the image fullscreen guiGetScreenSize Then draw the image with one of the functions that Furzy gave you
  22. Working on something a bit different.
  23. Try to debug it by adding some iprint where you have an IF and print the life of the source etc so you can see where the issue comes from
×
×
  • Create New...