Jump to content

WhoAmI

Members
  • Posts

    1,248
  • Joined

  • Last visited

Everything posted by WhoAmI

  1. Yea, I found horn's sound and I did the job. Thanks.
  2. You mean when key state is down the play sound, when up - stop sound?
  3. I did post in bugs.mtasa.com, and they told me that this function doesn't work for default's one. Anyway, any ideas?
  4. Then you use dbPoll. For example local query = dbQuery(handler, "SELECT * FROM users") local data = dbPoll(query, -1) for k,v in ipairs(data) do outputChatBox(v["column1"]) end It outputs all values saved in 'column1'. @OFFTOPIC: Wei 'Diet with russian vodka, lose 3 days in one week !' - Polish is the best one.
  5. For better safety you can generate salt, as IPB does. Random salt and the code would be md5( md5(salt) .. md5(password) ) That is the strongest hash.
  6. Just Citizen forgot about setting data, when someone reached hunter, thanks to him!
  7. I tried it before i wrote this topic, but thanks for trying.
  8. Told you that this function doesn't work for default's GTA sirens, only on added by script. Anyway, should be removeVehicleSirens(theVehicle) instead.
  9. function someoneReachedHunter(number, sort, model) -- get the element data gotHunter to check if he already got it once local alreadyGotHunter = getElementData(source, "gotHunter") if sort == "vehiclechange" and model == 425 and not alreadyGotHunter then outputChatBox ( getPlayerName(source).." #3366FFhas taken the hunter and gets #B30000$500!", getRootElement(), 255, 255, 255, true ) givePlayerMoney ( source, 500 ) setElementData(source, "gotHunter", true) --set the element data gotHunter to true to know he got it for the 1st time on this map end end addEvent("onPlayerPickUpRacePickup",true) addEventHandler("onPlayerPickUpRacePickup", root, someoneReachedHunter) -- reset gotHunter element data for everyone when the new map is starting addEvent("onMapStarting", true) function resetHunterStatus() for k, player in ipairs(getElementsByType("player")) do setElementData(player, "gotHunter", false) end end addEventHandler("onMapStarting", root, resetHunterStatus) Try this out.
  10. WhoAmI

    Engine sounds

    Hello, It's me again. How can I delete default engine's sounds developped by MTA, and upload new? I know that I should use playSound3D, but I have no idea how i can disable default voices. Here is an example of new enginge's sound.
  11. Then I can't play horn at all, I mean delete only sirens. I'm looking for solution for a long time...
  12. Well guys, I want to remove sirens from Barrack's truck, but removeVehicleSirens doesn't work for default gta's sirens. So i thought about turning off sirens, each time when player wants to turn them on. But there is question. How can I do that?
  13. WhoAmI

    Problem

    As 1st argument should be player as element. triggerClientEvent (source, "yaziyaz55", getRootElement() ) And when you triggerning from client triggerServerEvent("afkyazi2", localPlayer)
  14. Najprawdopodobniej nie masz daty "characters", tworzenie/spawn postaci działa Ci dobrze?
  15. Use xml functions, especially xmlCreateChild, xmlNodeSetAttribute. Save also account name with car and when you will spawn car, set data (setElementData) with account name. For example.: >model="1" x="1" y="1" z="1" account="acccount_name">>> function addVehicle (model, x, y, z, account_name) local file = xmlLoadFile("file.xml") --can be .map too local vehs = xmlCreateChild(file, "vehicle") -- adding a child to file if (texts) then xmlNodeSetAttribute(vehs, "model", model) --setting atribute to created child xmlNodeSetAttribute(vehs, "x", x) xmlNodeSetAttribute(vehs, "y", y) xmlNodeSetAttribute(vehs, "z", z) xmlNodeSetAttribute(vehs, "account_name", account_name) end xmlSaveFile(file) --saving and unloading file xmlUnloadFile(file) end
  16. WhoAmI

    SQLite

    Well, I did this, using https://addons.mozilla.org/pl/firefox/a ... e-manager/ and files .sqlite.
  17. WhoAmI

    SQLite

    Yea, I did same thing in MySQL and it works. Was disappointed why it isn't working here. It isn't working, when im deleting this, the column "ID" returns just nil. There is my code: handler = dbConnect("sqlite", "file.db") dbQuery(handler, "CREATE TABLE Persons(ID INT AUTO_INCREMENT NOT NULL, LastName varchar(255))") addCommandHandler("add", function () dbQuery(handler, "INSERT INTO Persons(LastName) VALUES (?)", "Jacob") end ) addCommandHandler("check", function () local data = dbQuery(handler, "SELECT * FROM Persons") if (data) then local result = dbPoll(data, -1) for k,v in ipairs(result) do outputChatBox(v["id"]..v["LastName"]) end end end ) And the v["id"] gives nil.
  18. WhoAmI

    SQLite

    handler = dbConnect("sqlite", "file.db") dbQuery(handler, "CREATE TABLE IF NOT EXISTS Persons(ID int NOT NULL AUTO_INCREMENT,LastName varchar(255) NOT NULL,FirstName varchar(255),Address varchar(255),City varchar(255))") Well, I did sth like this, but when im starting resource, file.db is clear. @EDIT: When i'm deleting "NOT NULL", everything is okey. Does MTA not support "NOT NULL"?
  19. WhoAmI

    SQLite

    What about dbQuery? I'll try.
  20. WhoAmI

    SQLite

    Nah. Same error. When im writing NOT_NUL, instead of NUT NULL there is no error, but when im getting the data, I can't get id cloumn's values.
  21. WhoAmI

    SQLite

    There's nothing to drop. Couse of error, tables didn't create.
  22. WhoAmI

    SQLite

    Both same error. http://snag.gy/wQyia.jpg
  23. WhoAmI

    SQLite

    Hi guys. I just want to now how I can create a table includes column with auto increment? executeSQLQuery("CREATE TABLE IF NOT EXISTS name (id NOT NULL AUTO_INCREMENT, other_stuff TEXT)") And it outputs error. Anyone knows?
  24. If num is defined as nuber, yea it's good.
×
×
  • Create New...