Jump to content

Gordon_G

Members
  • Posts

    282
  • Joined

  • Last visited

Posts 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. 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).

    • Like 1
  3. Hi,

     

    unknown.png 

     

    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 !

  4. 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

     unknown.png

    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

     

     

    • Like 2
  5. 6 hours ago, Tut said:

    Thread has been moved to a better suited forum for best results.

     

    Allowing custom gta3.img does block custom collisions of world objects. I'm not sure which configuration allows custom collisions?

    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 ^^' )

    • Like 1
  6. 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)

  7. 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 

    unknown.png 

    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 :

    unknown.png

    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)

  8. 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.

  9. 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

  10. 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

×
×
  • Create New...