Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. That won't fix anything, Pain. @devildead: Your acl is wrong, use this: "Admin"> "Moderator"> "SuperModerator"> "Admin"> "RPC"> "resource.admin"> "resource.webadmin"> "resource.DayZ"> "resource.login"> "resource.slothbot"> "user.Devil_Dead"> -- My account name "user.Angel_Dead"> "user.ADHOCNEW"> "resource.vip"> "Vip"> "user.Devil_Dead"> "user.Angel_Dead"> -- I add these 2 names in the file, not by command
  2. The script seems to be fine, did you set it as server side on the meta.xml? is the resource added to "Admin" group on the acl.xml?
  3. I guess that you could use rotation to check if he's facing another ped.
  4. Works perfect here.
  5. Maybe the data is set too late?
  6. Read my latest post, I edited it. I used this code to test it: local sqliteData = "accountName STRING, cash INT, mapsPlayed INT, mapsWon INT, everPurchasedNametagColor INT, level INT, unlockedAchievements INT, totalTimesJoined INT, totalHunters INT, totalToptimes INT, totalMoneyEarned INT, totalMoneySent INT, totalBets INT, totalBetsEarned INT, totalBetsWon INT, totalDeaths INT, totalPlayingTimeMinutes INT, totalPlayingTimeHours INT, totalReactionTests INT, bestReactionTime INT, ach1 INT, ach2 INT, ach3 INT, ach4 INT, ach5 INT, ach6 INT, ach7 INT, ach8 INT, ach9 INT, ach10 INT, ach11 INT, ach12 INT, ach13 INT, ach14 INT, ach15 INT, ach16 INT, ach17 INT, ach18 INT, ach19 INT, ach20 INT, ach21 INT, ach22 INT, ach23 INT, ach24 INT, ach25 INT, ach26 INT, ach27 INT, ach28 INT, ach29 INT, ach30 INT, ach31 INT, ach32 INT, ach33 INT, ach34 INT, ach35 INT, ach36 INT, ach37 INT, ach38 INT, ach39 INT, ach40 INT, everPurchasedSkin INT, everSetCustomVehicleColor INT, useCustomVehicleColor STRING, c1 INT, c2 INT, c3 INT, c4 INT, hlcRed INT, hlcBlue INT, hlcGreen INT, admin_redo INT, admin_nextmap INT, allowPersonalDetails STRING, allowStats STRING, useCustomNametag STRING, useCustomSkin STRING, soundMessage STRING, soundRequest STRING, showOnDeath STRING, useHunterSkin STRING, chatAcceptMode INT, joinedBefore INT, horn1 INT, horn2 INT, horn3 INT, horn4 INT, horn5 INT, horn6 INT, horn7 INT, lastSetHorn INT, pName STRING, pAge STRING, pEmail STRING, pMsn STIRNG, pSkype STRING, pXfire STRING, pICQ STRING, pXBL STRING, convertedTotal INT" addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), function ( ) executeSQLCreateTable ( "userpanel", tostring ( sqliteData ) ) end ) function loadPlayerData ( player, datatype ) local sourceAccount = getPlayerAccount ( player ) if isGuestAccount ( sourceAccount ) then return false else local accountName = getAccountName ( sourceAccount ) if ( accountName ) then local playerRootNode = executeSQLQuery ( "SELECT * FROM userpanel WHERE accountName = ?", tostring ( accountName ) ) if ( type ( playerRootNode ) == "table" and #playerRootNode == 0 or not playerRootNode ) then return executeSQLQuery ( "INSERT INTO userpanel ( accountName, ".. tostring ( datatype ) .." ) VALUES ( ?, ? )", tostring ( accountName ), newvalue ) else return playerRootNode [ 1 ] [ datatype ] end end end end function savePlayerData ( player, datatype, newvalue ) local sourceAccount = getPlayerAccount ( player ) if isGuestAccount ( sourceAccount ) then return false else local accountName = getAccountName ( sourceAccount ) if ( accountName ) then local playerRootNode = executeSQLQuery ( "SELECT accountName FROM userpanel WHERE accountName = ?", tostring ( accountName ) ) if ( type ( playerRootNode ) == "table" and #playerRootNode == 0 or not playerRootNode ) then return executeSQLQuery ( "INSERT INTO userpanel ( accountName, ".. tostring ( datatype ) .." ) VALUES ( ?, ? )", tostring ( accountName ), newvalue ) else return executeSQLQuery ( "UPDATE userpanel SET ".. tostring ( datatype ) .." = ? WHERE accountName = ?", newvalue, tostring ( accountName ) ) end end end end addCommandHandler ( "save", function ( thePlayer, _, data, value ) savePlayerData ( thePlayer, data, value ) end ) addCommandHandler ( "load", function ( thePlayer, _, data ) local value = loadPlayerData ( thePlayer, data ) outputChatBox ( tostring ( value ) ) end )
  7. Mind posting it? Edit: I just tested it with a table with 2 columns and it works, no errors, no duplicates.
  8. Post your function to create the table.
  9. Well, you should have stored the objects on a table, since if you use it, then another player does it too, it'll bug the script. local cigarettes = { } function cigarette ( thePlayer ) if ( not isElement ( cigarettes [ thePlayer ] ) ) then local x, y, z = getElementPosition ( thePlayer ) cigarettes [ thePlayer ] = createObject ( 1485, 0, 0, 0 ) exports [ "bone_attach" ]:attachElementToBone ( cigarettes [ thePlayer ], thePlayer, 1, -0.01, -0.01, -0.02, 90, 90, 0 ) toggleControl ( thePlayer, "jump", false ) toggleControl ( thePlayer, "sprint", false ) toggleControl ( thePlayer, "crouch", false ) else toggleControl ( thePlayer, "jump", true ) toggleControl ( thePlayer, "sprint", true ) toggleControl ( thePlayer, "crouch", true ) destroyElement ( cigarettes [ thePlayer ] ) end end addCommandHandler ( "smoke", cigarette ) Now you just need to use "/smoke". Edit: @Mr.Pres[T]ege: Your script has the same problem.
  10. function loadPlayerData ( player, datatype ) local sourceAccount = getPlayerAccount ( player ) if isGuestAccount ( sourceAccount ) then return false else local accountName = getAccountName ( sourceAccount ) if ( accountName ) then local playerRootNode = executeSQLQuery ( "SELECT * FROM userpanel WHERE accountName = ?", tostring ( accountName ) ) if ( type ( playerRootNode ) == "table" and #playerRootNode == 0 or not playerRootNode ) then return executeSQLQuery ( "INSERT INTO userpanel ( accountName, ".. tostring ( datatype ) .." ) VALUES ( ?, ? )", tostring ( accountName ), newvalue ) else return playerRootNode [ 1 ] [ datatype ] end end end end function savePlayerData ( player, datatype, newvalue ) local sourceAccount = getPlayerAccount ( player ) if isGuestAccount ( sourceAccount ) then return false else local accountName = getAccountName ( sourceAccount ) if ( accountName ) then local playerRootNode = executeSQLQuery ( "SELECT accountName FROM userpanel WHERE accountName = ?", tostring ( accountName ) ) if ( type ( playerRootNode ) == "table" and #playerRootNode == 0 or not playerRootNode ) then return executeSQLQuery ( "INSERT INTO userpanel ( accountName, ".. tostring ( datatype ) .." ) VALUES ( ?, ? )", tostring ( accountName ), newvalue ) else return executeSQLQuery ( "UPDATE userpanel SET ".. tostring ( datatype ) .." = ? WHERE accountName = ?", newvalue, tostring ( accountName ) ) end end end end Try it.
  11. I'll lock the topic, as for what it seems, is going out of topic.
  12. Client side: https://wiki.multitheftauto.com/wiki/Cl ... de_scripts De server side no encontre, pero creo que con lo que te dice en el client side, podes darte cuenta de que es server side.
  13. You can by setting it to false or nil, i tried before and it was removed but i don't remember which one. Oh, with false it works, I had tried something like this before, since this was already asked, but it didn't work, maybe I tried with nil.
  14. Check the debugscript for errors on the server side script.
  15. The row on the database, it can't be removed.
  16. I know that you can do that, but you can't remove the data, like you can with element data.
  17. There's already a function for that: getAccount
  18. ":" is used to create/use files to/from another resources.
  19. Well, here it created it just fine.
  20. The script works fine, the problem is on your side.
  21. You are checking on your server resources folder? because if you are doing that, then you are checking the wrong path, it's on the downloaded client folder.
×
×
  • Create New...