• Announcements

    • jhxp

      Forums are online again after a maintenance.   18/03/17

      MTA Forums maintenance is completed, although some automatic time-heavy tasks are still in process and will be finished eventually in background. Expect some features such as Forum Search to not display all results until all processes are finished. Please let us know if you spot a forum feature that worked correctly before the maintenance but does not work anymore now. Thanks. --MTA Team

Ayush Rathore

Members
  • Content count

    107
  • Joined

  • Last visited

  • Days Won

    1

Ayush Rathore last won the day on March 11

Ayush Rathore had the most liked content!

Community Reputation

32 Good

1 Follower

About Ayush Rathore

  • Rank
    Punk-@ss B*tch
  • Birthday April 27

Details

  • Gang
    NONE
  • Location
    India
  • Occupation
    Killing People
  • Interests
    Scripting(server,client,gui,sql),Mapping
  1. https://wiki.multitheftauto.com/wiki/OnPlayerLogin go there you will get to know why i used this _,acc thingy and also to see that table thingy you need to logout and login again
  2. addEventHandler("onResourceStart", resourceRoot, function (resource) connectionDb = dbConnect("sqlite", "user_settings.db") if connectionDb then outputDebugString( "Connection with database was successfully established." ) dbExec(connectionDb,"create table if not exists settings(playerName TEXT, carReflect NUMBER, water NUMBER, contrast NUMBER, detail NUMBER, sky NUMBER, showFps NUMBER)") else outputDebugString( "Connection with database couldn't be established." ) end end ) function playerLogin(_,acc) local accName = getAccountName(acc) local playerQuery = dbQuery(connectionDb,"SELECT * FROM settings WHERE playerName=?",accName) local playerQueryResult = dbPoll(playerQuery, -1) if #playerQueryResult == 0 then -- if he is new user local createPlayerIndex = dbExec(connectionDb, "INSERT INTO settings VALUES(?,?,?,?,?,?,?)",accName,1,1,1,1,1,1) else -- if he is old user then load here -- do your stuff for rid, row in pairs (playerQueryResult) do -- row represents the tables that are in 'playerQueryResult', which represent the rows for column, value in pairs (row) do -- column represents column name, value represents column value outputChatBox(column..', '..value) end end end end addEventHandler("onPlayerLogin", getRootElement(), playerLogin) run this thing you will get to know everything btw delete your old user_settings.db @DriFtyZ @DriFtyZ login logout or reconnect and login to check it
  3. your first column is of type integer so how could you write a text in it ?
  4. Try this addEventHandler("onResourceStart", resourceRoot, function (resource) connectionDb = dbConnect("sqlite", "user_settings.db") if connectionDb then outputDebugString( "Connection with database was successfully established." ) dbExec(connectionDb,"create table if not exists settings(id INTEGER PRIMARY KEY, playerName TEXT, carReflect NUMBER, water NUMBER, contrast NUMBER, detail NUMBER, sky NUMBER, showFps NUMBER)") else outputDebugString( "Connection with database couldn't be established." ) end end ) function playerLogin(_,acc) local accName = getAccountName(acc) local playerQuery = dbQuery(connectionDb,"SELECT * FROM settings WHERE playerName=?",accName) local playerQueryResult = dbPoll(playerQuery, -1) if #playerQueryResult == 0 then local createPlayerIndex = dbExec(connectionDb, "INSERT INTO settings VALUES(?,?,?,?,?,?,?,?)",1,1,1,1,1,1,1,1) end end addEventHandler("onPlayerLogin", getRootElement(), playerLogin)
  5. also u should use some debugging statement like this function playerLogin(source) local playerAcc = getPlayerAccount(source) local accName = getAccountName(source) local playerQuery = dbQuery(connectionDb,"SELECT * FROM settings WHERE playerName='..accName..'") local playerQueryResult = dbPoll(playerQuery, -1) if #playerQueryResult == 0 then outputDebugString(getPlayerName(source).." Creating new settings") local createPlayerIndex = dbExec(connectionDb, "INSERT INTO settings (playerName,carReflect,water,contrast,detail,sky,showFps) VALUES ('..accName..', 1, 1, 1, 1, 1, 1") if createPlayerIndex then outputDebugString(getPlayerName(source).." Creating new settings went successful.") else outputDebugString(getPlayerName(source).." Creating new settings failed check your db connection.") end end end addEventHandler("onPlayerLogin", resourceRoot, playerLogin)
  6. Selling mistake see function playerLogin(source) local playerAcc = getPlayerAccount(source) local accName = getAccountName(source) local playerQuery = dbQuery(connectionDb,"SELECT * FROM settings WHERE playerName='..accName..'") local playerQueryResult = dbPoll(playerQuery, -1) if #playerQueryResult == 0 then local createPlayerIndex = dbExec(connectionDb, "INSERT INTO settings (playerName,carReflect,water,contrast,detail,sky,showFps) VALUES ('..accName..', 1, 1, 1, 1, 1, 1") end end addEventHandler("onPlayerLogin", resourceRoot, playerLogin) its dbQuery not dbQuerry
  7. https://community.multitheftauto.com/index.php?p=resources&s=details&id=12448 this resource might help you
  8. projectile

    function attackIntruderA51 () local t={} t[#t+1] = createProjectile (localPlayer, 20, 15.49994, 1719.1, 25.5, 5, localPlayer, 0, 0, 0, 0, 0, 1) t[#t+1] = createProjectile (localPlayer, 20, 237.7, 1696.8, 25.5, 5, localPlayer, 0, 0, 0, 0, 0, 1) for _,projectile in pairs (t) do for i,v in pairs(getAttachedElements(projectile)) do if (getElementType(v)=='blip') then setBlipColor(v,255,0,0,255); end end end end addCommandHandler ("attack", attackIntruderA51) Use this it might fulfill your need
  9. @JanKy mix your "onClientResourceStart" functions into one function and also put night_init() in the first line of function like this function loadShaders () InselMapStart() night_init() for path,texstures in pairs (shaderMap) do local shader = dxCreateShader('shader.fx') table.insert(shaderList, shader) local terrain = dxCreateTexture(path) dxSetShaderValue(shader, 'gTexture', terrain) for i,txd in ipairs (texstures) do engineRemoveShaderFromWorldTexture(nightShader, txd) engineApplyShaderToWorldTexture(shader,txd) end end end addEventHandler( "onClientResourceStart", resourceRoot, loadShaders )
  10. Count me in @IIYAMA
  11. if you need any scripting help you should go to this link https://wiki.multitheftauto.com/ for a proper understanding on how we pass Parameter in Mta functions
  12. provide the Gui Creation code like guiCreate window and and guiCreateGridlist etc .
  13. Great Work keep it up!
  14. ok