Ayush Rathore

Members
  • Content count

    114
  • Joined

  • Last visited

  • Days Won

    1

Ayush Rathore last won the day on March 11

Ayush Rathore had the most liked content!

Community Reputation

33 Good

3 Followers

About Ayush Rathore

  • Rank
    Sucka
  • Birthday April 27

Details

  • Gang
    NONE
  • Location
    India
  • Occupation
    Killing People
  • Interests
    Scripting(server,client,gui,sql),Mapping
  1. use this tag in meta file its the easiest way --in meta.xml of every resource you want to download earlier than login panel <download_priority_group>1</download_priority_group> --increse the value in every resource by one <download_priority_group>2</download_priority_group> <download_priority_group>3</download_priority_group> <download_priority_group>4</download_priority_group> --...... all resources you want to be downloaded before login --and lastly add the below line in meta.xml of login <download_priority_group>0</download_priority_group>
  2. function pairsByKeys (t, f) local a = {} for n in pairs(t) do table.insert(a, n) end table.sort(a, f) local i = 0 -- iterator variable local iter = function () -- iterator function i = i + 1 if a[i] == nil then return nil else return a[i], t[a[i]] end end return iter end function aktualizujKontakty() lista={} for i,v in ipairs(getElementsByType("player")) do if v~=localPlayer then lista[getPlayerName(v)]={v,getElementData(localPlayer,"PW:"..getPlayerName(v)) or ""} end end end function wyswietlKontakty() guiGridListClear(gridlist[1]) for i,v in pairsByKeys(lista) do -- see this line r=guiGridListAddRow(gridlist[1]) guiGridListSetItemText(gridlist[1],r,1,skipColorCode(i),false,false) guiGridListSetItemData(gridlist[1],r,1,i) if nieodczytane[i] then guiGridListSetItemColor(gridlist[1],r,1,0,255,0) end if zablokowany[i] then guiGridListSetItemColor(gridlist[1],r,1,255,0,0) end end end This will sort table by key and will add players automatically
  3. So i would ask u if you can make changes to your saving system by adding two column for banAccount and banTime and then on player Login by that account he can never cheat and also go to below link and u will get to know that Mac Addresses can also be changed so my above method will be best
  4. BTW you should first read mta wiki if u are a scripter Server Side : function playerDamageCheckForSniper ( attacker, weapon, bodypart, loss ) if ( weapon == 34 ) then killPed ( source, attacker, weapon, bodypart ) end end addEventHandler ( "onPlayerDamage", getRootElement (), playerDamageCheckForSniper ) this would do the trick
  5. In my opinion only serial will suffice for your ban system as serial cant be changed of a pc or laptop and also if you have a data saving system make it store values on basis of serial key which means SERIALNUMBER WILL BE PRIMARY KEY OF YOUR DATABASE Happy scripting making it unexploitable
  6. try this function onThisResourceStart ( ) downloadFile ( "test.png" ) end addEventHandler ( "onClientResourceStart", resourceRoot, onThisResourceStart ) function onDownloadFinish ( file, success ) if ( source == resourceRoot ) then if ( success ) then if ( file == "test.png" ) then outputChatBox ( "test.png downloaded" ) end else if ( file == "test.png" ) then outputChatBox ( "test.png failed to download" ) end end end end addEventHandler ( "onClientFileDownloadComplete", root, onDownloadFinish ) And also add in meta.xml the attribute download="false" and also add this line in your meta <min_mta_version client="1.5.4" server="1.5.4" /> happy scripting
  7. using html http://community.multitheftauto.com/index.php?p=resources&s=details&id=12905 this might help you
  8. 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
  9. 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
  10. your first column is of type integer so how could you write a text in it ?
  11. 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)
  12. 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)
  13. 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
  14. https://community.multitheftauto.com/index.php?p=resources&s=details&id=12448 this resource might help you
  15. 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