Jump to content

golanu21

Members
  • Posts

    650
  • Joined

  • Last visited

Everything posted by golanu21

  1. eu mai exct folosesc wamp....dar tot ceva de genu fac ca sa ma conectez ? dbConnect("mysql", "dbname="..dbname..";host="..host, username, password, "autoreconnect=1")
  2. si cum fac sa ajung in sql, ( phpmyadmin )?
  3. No, for the moment the votes are: 2 votes for golanu21, 1 vote for bandi94, 2 votes for Axel. If I am wrong, tell me where are the 4 votes because I've seen only 2. Also, Ransom didn't ask for 'votes', he asked for suggestions for a moderator here (which isn't really needed, this forum isn't very active). This section isn't active, and I think it doesn't need moderators yet. Since Ransom asked for moderation I think there is some activity going on. Recently, the number of romanians on forums almost tripled. You don't have to repeat in every single post that this section is not active, you have already told us your opinion at the beginning and it seems you are the only one with that belief. Secondly, why are the outsiders so concerned about the fate of our community, they do not even know the language of this section to understand what's on these topics?! +1
  4. the Master, mr.s3d, rpp|dany, seek, for me... axel : I, QuantumZ, tomitza .. bandi92 : the master, mrs3d, you
  5. function connect(res) connection = mysql_connect("localhost", "root", "", "zombiesv", 3306) if (not connection) then if (res == getThisResource()) then cancelEvent(true, "Nu te poti conecta la baza de date.") end return nil end return nil end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), connect, false) 2: attempt to call global mysql_connect <a nil value>
  6. nope , valhalla is so bugged, i can't use it
  7. i need to make it with module function...
  8. ai uitat sa opresti functia ... ai uitat un end
  9. function connect(res) connection = mysql_connect("localhost", "root", "", "zombiesv", 3306) if (not connection) then if (res == getThisResource()) then cancelEvent(true, "Nu te poti conecta la baza de date.") end return nil end return nil end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), connect, false) [center]2: attempt to call global mysql_connect <a nil value>[/center]
  10. ok, for the moment the vote are : 4 votes Golanu21 ,3 votes bandi94, 3 votes axel
  11. dbExec este o functie query care nu returneaza un rezultat si executa direct in baza de date. dbQuery este o functie query care returneaza un rezultat dupa apelare. De exemplu daca vrei sa selectezi un caracter din baza de date ai nevoie de returnarea valorilor: Selecteaza caracterele local char = dbQuery ( char_db , "SELECT * FROM characters WHERE account=?", "QuantumZ" ) Pentru a prelucra datele din dbQuery avem nevoie de alte doua functii dbPoll (care insereaza datele in variabile) si dbFree (care elibereaza variabila de date) -- O functie care afiseaza caracterele cu viata <500 local chars = dbQuery ( char_db , "SELECT * FROM characters" ) -- functia returneaza toate caracterele din tabelul characters local result, numrows = dbPoll(chars, -1) -- -1 inseamna sa astepte serverul pana termina de verificat, 0 inseamna instant dar poate da erori si nu recomand if (result and numrows > 0) then -- daca avem un rezultat si numarul de randuri >0 atunci for index, row in pairs(result) do if row['health']<500 then outputChatBox(row['name'].." are mai putin de 500 viata.") end end end dbFree(chars) -- elibereaza conexiunea chiar ma ajuta mult , mersi , vreau sa fac un sistem de characters la gamemodeul de zombie EDIT: dbExec, si executeSQLQuery sunt aceleas lucruri ?
  12. Golanu, eu nu am nimic cu mine, chiar am fost transparent in tot acest timp si te respect ca pe toti ceilalti, daca vroiai sa ma intrebi (din cate vad din titlu, nici nu prea ai fost explicit) puteai sa-mi trimiti un PM, nu sa creezi atata zarva pe forum. Daca vrei sa faci public gm-ul ramane la atitudinea ta desi nu ar strica un server unic de zombie. Eu nu am pe ce rang sa ma bat, am scris in Section Moderator ca nu-mi doresc sa fiu moderator. toata chestia pentru care vreau sa dau gm-ul este pentru ca nu am ajutor...am facut 70% din gamemode singur.. si mai ma ajutat axel la 2-3 scripturi...
  13. Haide sa o luam logic. Pasul 1: Trebuie sa conectam scriptul nostru la baza de date SQLite. ( https://wiki.multitheftauto.com/wiki/DbConnect ) Exemplu: = dbConnect( "sqlite", ".db" ) In cazul tau sa luam drept exemplu (atentie daca fisierul char.db nu exista acesta va fi creat automat): char_db = dbConnect( "sqlite", "char.db" ) Ca sa conectezi alta resursa externa la baza de date din resursa ta folosesti: char_db = dbConnect( "sqlite", ":numeleresursei/char.db" ) Pasul 2: Ne gandim cam ce tabele ne-ar trebui pentru character-systems. (Tip: Numele tabelelor in MySQL/SQLite trebuie scrise cu litere mici si sa fie la plural. Acesta este standardul in bazele de date.) Numele tabelului nostru va fi "characters". Acum ne gandim cam ce coloane ar trebui sa aibe acest tabel "characters". Sa vedem, avem nevoie de un PRIMARY KEY (cheie primara) care sa identifce fiecare caracter in parte. Asa ca vom adauga coloana "id" cu AUTOINCREMENT (adica pentru fiecare caracter adaugat numarul "id"-ului se va auto incrementa. Alte coloane pentru sistemul tau de caractere ar putea fi: nume, model (pentru modelul pedului), health (viata), posx, posy, posz (toate acestea pentru salvarea pozitiei) etc. Asta ar fi basic-ul pentru un character systems. Acum urmeaza crearea acestui tabel: function creeazaTabel() local characters = dbExec( char_db, "CREATE TABLE IF NOT EXISTS characters (id INT PRIMARY KEY NOT NULL, nume CHAR(50) NOT NULL, model INT NOT NULL, health REAL NOT NULL, posx REAL NOT NULL, posy REAL NOT NULL, posz REAL NOT NULL)") addEventHandler("onResourceStart", getRootElement(getThisResource()), creeazaTabel) INT = numar intreg (stim ca id-ul trebuie sa fie numar intreg, modelele peds-ilor in MTA sunt numere intregi (exemplu: https://wiki.multitheftauto.com/wiki/Character_Skins ) REAL = in MTA nu exista tipul REAL, ci FLOAT sau DOUBLE, din fericire SQLite poate integra in REAL atat float si double. Pozitia caracterlor in MTA si viata este de tip FLOAT. (exemplu 1003.532622) Pasul 3: Functia de inserare a unui nou caracter Ne bazam pe linia asta de cod: dbExec( char_db, "INSERT INTO characters (nume, model, health, posx, posy, posz) VALUES (?,?,?,?,?,?)", numele, model, health, posx, posy, posz ) Pentru a insera caracterul si al spawna la coordonatele 0, 0, 0 pentru inceput folosim: dbExec( char_db, "INSERT INTO characters (nume, model, health, posx, posy, posz) VALUES (?,?,?,?,?,?)", "Tanti Lucica", idmodel, 1000, 0, 0, 0 ) Pasul 4: Cum actualizam detaliile caracterului dupa ce iese de pe server? Folosesti functia UPDATE ( https://wiki.multitheftauto.com/wiki/DbExec ) dbExec( char_db, "UPDATE `??` SET `??`=?", tableName, columnName, columnValue ) Atentie, poate sa contina erori, l-am scris in graba de pe tableta. Daca gasiti vreo greseala anuntati-ma si voi edita postul. chiar mai ajutat si pe mn, ms mult , dar mai am o intrebare , la ce foloseste dbQuery ?
  14. Ce rang wtf...mane eu te+am intrebat daca vrei gm-ul... ....mane daca nu ma vreti voi astia cu experienta ca moderator scriu acolo ca renunt pur si simplu si va las sa va bateti pe rang..decat sa imi pierd prietenia si cu axel si cu tine (bine cu tn nu prea am vb..dar daca te afli la sec romana te-am lo-at ca un tovaras)
  15. DAU GAMEMODUL CU ZOMBIE NUMAI PENTRU SECTIUNEA ROMANA , 70% terminat EDITED D
  16. I have checked these forums quite often but never seen that user bandi. +1
  17. ok, for the moment the vote are : 4 votes Golanu21 ,3 votes bandi94, 2 votes axel
  18. golanu21

    help

    man, i want for example function killPlayerIfTheyPressThisKey ( thePlayer, key ) if ( getControlState ( thePlayer, key ) ) then outputChatBox ( "You can do that..", thePlayer ) --THERE IS PUSHING, something like slap but in other direction else --- end end
  19. golanu21

    help

    hi guys, i want to make a script.. but idk how.. i want when player make something... to PUSH it in a direction..
  20. ok, for the moment the vote are : 4 votes Golanu21 ,2 votes bandi94, 2 votes axel i know , this can be changed... but I collected it for the moment. EDIT: i give a vote for axel
  21. axel, sEEk and all , vote.. and Randsom decide.
  22. man you need skripting skills , but if you have sripting skills and no activity... P.S: for questions with scripting exist a scripting section on MTA forum..
×
×
  • Create New...