Jump to content

Baseplate

Members
  • Posts

    1,417
  • Joined

  • Last visited

Everything posted by Baseplate

  1. Baseplate

    Bad args

    Cause on logout, it doesn't update, tried to use a timer so probably it gets some time to save.
  2. Baseplate

    Bad args

    connection is already defined at the start of the script, and I didn't copy the whole script. Debug errors. [2013-11-05 10:31:43] WARNING: SANGsave\s.lua:93: Bad argument @ 'getElementModel' [Expected element at argument 1, got nil] [2013-11-05 10:31:43] WARNING: SANGsave\s.lua:93: Bad argument @ 'getElementInterior' [Expected element at argument 1, got nil] [2013-11-05 10:31:43] WARNING: SANGsave\s.lua:93: Bad argument @ 'getElementDimension' [Expected element at argument 1, got nil] [2013-11-05 10:31:43] WARNING: SANGsave\s.lua:93: Bad argument @ 'getPlayerWantedLevel' [2013-11-05 10:31:43] WARNING: SANGsave\s.lua:93: Bad argument @ 'getPlayerMoney' [2013-11-05 10:31:43] WARNING: SANGsave\s.lua:93: Bad argument @ 'getElementData' [Expected element at argument 1, got nil] [2013-11-05 10:31:43] WARNING: SANGsave\s.lua:93: Bad argument @ 'getPlayerTeam' [2013-11-05 10:31:43] WARNING: SANGsave\s.lua:93: Bad argument @ 'getTeamName' [2013-11-05 10:31:43] WARNING: SANGsave\s.lua:93: Bad argument @ 'getPlayerName' [Expected element at argument 1, got nil] [2013-11-05 10:31:43] WARNING: SANGsave\s.lua:93: Bad argument @ 'getElementData' [Expected element at argument 1, got nil] [2013-11-05 10:31:43] WARNING: SANGsave\s.lua:94: Bad argument @ 'getPedTotalAmmo' [2013-11-05 10:31:43] WARNING: SANGsave\s.lua:94: Bad argument @ 'getPedTotalAmmo' [2013-11-05 10:31:43] WARNING: SANGsave\s.lua:94: Bad argument @ 'getPedTotalAmmo' [2013-11-05 10:31:43] WARNING: SANGsave\s.lua:94: Bad argument @ 'getPedTotalAmmo' [2013-11-05 10:31:43] WARNING: SANGsave\s.lua:94: Bad argument @ 'getPedTotalAmmo' [2013-11-05 10:31:43] WARNING: SANGsave\s.lua:94: Bad argument @ 'getPedTotalAmmo' [2013-11-05 10:31:43] WARNING: SANGsave\s.lua:94: Bad argument @ 'getPedTotalAmmo' [2013-11-05 10:31:43] WARNING: SANGsave\s.lua:94: Bad argument @ 'getPedTotalAmmo' [2013-11-05 10:31:43] WARNING: SANGsave\s.lua:94: Bad argument @ 'getPedTotalAmmo' [2013-11-05 10:31:43] WARNING: SANGsave\s.lua:94: Bad argument @ 'getPedTotalAmmo' [2013-11-05 10:31:43] WARNING: SANGsave\s.lua:94: Bad argument @ 'getPedTotalAmmo' [2013-11-05 10:31:43] WARNING: SANGsave\s.lua:94: Bad argument @ 'getPedTotalAmmo' [2013-11-05 10:31:43] WARNING: SANGsave\s.lua:94: Bad argument @ 'getPedTotalAmmo' [2013-11-05 10:31:43] WARNING: SANGsave\s.lua:94: Bad argument @ 'getPedStat' [2013-11-05 10:31:43] WARNING: SANGsave\s.lua:94: Bad argument @ 'getPedStat' [2013-11-05 10:31:43] WARNING: SANGsave\s.lua:94: Bad argument @ 'getPedStat' [2013-11-05 10:31:43] WARNING: SANGsave\s.lua:94: Bad argument @ 'getPedStat' [2013-11-05 10:31:43] WARNING: SANGsave\s.lua:94: Bad argument @ 'getPedStat' [2013-11-05 10:31:43] WARNING: SANGsave\s.lua:94: Bad argument @ 'getPedStat' [2013-11-05 10:31:43] WARNING: SANGsave\s.lua:94: Bad argument @ 'getPedStat' [2013-11-05 10:31:43] WARNING: SANGsave\s.lua:94: Bad argument @ 'getPedStat' [2013-11-05 10:31:43] WARNING: SANGsave\s.lua:94: Bad argument @ 'getPedStat' [2013-11-05 10:31:43] WARNING: SANGsave\s.lua:94: Bad argument @ 'getPedStat' [2013-11-05 10:31:43] WARNING: SANGsave\s.lua:94: Bad argument @ 'getPedStat'
  3. Baseplate

    Bad args

    function saveThings(thePreviousAccount) x, y, z = getElementPosition(source) setTimer(function(source) dbExec(connection, "UPDATE players SET skin=?, x=?, y=?, z=?, int=?, dim=?, wanted=?, money=?, occupation=?, team=?, nick=?, wp=? WHERE account=?", tostring(getElementModel(source)), tostring(x), tostring(y), tostring(z), tostring(getElementInterior(source)), tostring(getElementDimension(source)), tostring(getPlayerWantedLevel(source)), tostring(getPlayerMoney(source)), tostring(getElementData(source, "Occupation")), tostring(getTeamName(getPlayerTeam(source))), tostring(getPlayerName(source)), tostring(getElementData(source, "wantedPoints")), thePreviousAccount) dbExec(connection, "UPDATE weapons SET playerWeaponAmmo0=?, playerWeaponAmmo1=?, playerWeaponAmmo2=?, playerWeaponAmmo3=?, playerWeaponAmmo4=?, playerWeaponAmmo5=?, playerWeaponAmmo6=?, playerWeaponAmmo7=?, playerWeaponAmmo8=?, playerWeaponAmmo9=?, playerWeaponAmmo10=?, playerWeaponAmmo11=?, playerWeaponAmmo10=?, pistolstat=?, silencedstat=?, desertstat=?, shotgunstat=?, sawnoffstat=?, spazstat=?, microstat=?, mp5stat=?, akstat=?, m4stat=?, sniperstat=? WHERE account=?", getPedTotalAmmo(source, 0), getPedTotalAmmo(source, 1), getPedTotalAmmo(source, 2), getPedTotalAmmo(source, 3), getPedTotalAmmo(source, 4), getPedTotalAmmo(source, 5), getPedTotalAmmo(source, 6), getPedTotalAmmo(source, 7), getPedTotalAmmo(source, 8) , getPedTotalAmmo(source, 9), getPedTotalAmmo(source, 10), getPedTotalAmmo(source, 11), getPedTotalAmmo(source, 12), getPedStat(source,69), getPedStat(source,70), getPedStat(source,71), getPedStat(source,72), getPedStat(source,73), getPedStat(source,74), getPedStat(source,75), getPedStat(source,76), getPedStat(source,77), getPedStat(source,78), getPedStat(source,79), thePreviousAccount) end, 2000, 1) end addEventHandler("onPlayerLogout", root, saveThings) Returns bad arguements when I use dbExec.
  4. Loc, the fuck is this supposed to mean?
  5. Ya miboun chkoun jbad sorm jad bou bouk ya 3attay ya PD ya mnayek.
  6. Ah, it doesn't update anything on logout, no errors on debug, yet it updates weapons and weps stats...
  7. What does that mean? I didn't get your point...
  8. Use takePlayerMoney serversided.
  9. Let's just bump this to make people look into my problem....
  10. Baseplate

    SQL

    Everyone got his own opinion, I find SQLite easier to use and more helpful, others may disagree but this is my own opinion.
  11. Baseplate

    SQL

    INSERT INTO syntax to save a player stat, and then SELECT FROM syntax to select/call it again..
  12. executeSQLQuery("UPDATE players SET skin=?, x=?, y=?, z=?, int=?, dim=?, wanted=?, money=?, occupation=?, team=? WHERE account=?", getElementModel(source), x, y, z, getElementInterior(source), getElementDimension(source), getPlayerWantedLevel(source), getPlayerMoney(source), getElementData(source, "Occupation"), getTeamName(getPlayerTeam(source)), acc) Nothing happens..
  13. I did make it like, if there is no data on login, it will insert some data, but yet, nothing happens.
  14. addEventHandler ("onResourceStart", root, function() executeSQLQuery("CREATE TABLE IF NOT EXISTS players(account STRING, skin STRING, x STRING, y STRING, z STRING, int STRING, dim STRING, wanted STRING, money STRING, occupation STRING, team STRING)") executeSQLQuery("CREATE TABLE IF NOT EXISTS weapons(account STRING,playerWeaponID0 STRING,playerWeaponID1 STRING,playerWeaponID2 STRING,playerWeaponID3 STRING,playerWeaponID4 STRING,playerWeaponID5 STRING,playerWeaponID6 STRING,playerWeaponID7 STRING,playerWeaponID8 STRING,playerWeaponID9 STRING,playerWeaponID10 STRING,playerWeaponID11 STRING,playerWeaponID12 STRING,playerWeaponAmmo0 STRING,playerWeaponAmmo1 STRING,playerWeaponAmmo2 STRING,playerWeaponAmmo3 STRING,playerWeaponAmmo4 STRING,playerWeaponAmmo5 STRING,playerWeaponAmmo6 STRING,playerWeaponAmmo7 STRING,playerWeaponAmmo8 STRING,playerWeaponAmmo9 STRING,playerWeaponAmmo10 STRING,playerWeaponAmmo11 STRING,playerWeaponAmmo12 STRING,pistolstat STRING,silencedstat STRING,desertstat STRING,shotgunstat STRING,sawnoffstat STRING,spazstat STRING,microstat STRING,mp5stat STRING,akstat STRING,m4stat STRING,sniperstat STRING)") end ) function saveThings() local acc = getAccountName(getPlayerAccount(source)) local x, y, z = getElementPosition(source) --Weps executeSQLQuery("UPDATE weapons SET playerWeaponID0=? WHERE account=?", getPedWeapon(source,0), acc) executeSQLQuery("UPDATE weapons SET playerWeaponID1=? WHERE account=?", getPedWeapon(source,1), acc) executeSQLQuery("UPDATE weapons SET playerWeaponID2=? WHERE account=?", getPedWeapon(source,2), acc) executeSQLQuery("UPDATE weapons SET playerWeaponID3=? WHERE account=?", getPedWeapon(source,3), acc) executeSQLQuery("UPDATE weapons SET playerWeaponID4=? WHERE account=?", getPedWeapon(source,4), acc) executeSQLQuery("UPDATE weapons SET playerWeaponID5=? WHERE account=?", getPedWeapon(source,5), acc) executeSQLQuery("UPDATE weapons SET playerWeaponID6=? WHERE account=?", getPedWeapon(source,6), acc) executeSQLQuery("UPDATE weapons SET playerWeaponID7=? WHERE account=?", getPedWeapon(source,7), acc) executeSQLQuery("UPDATE weapons SET playerWeaponID8=? WHERE account=?", getPedWeapon(source,8), acc) executeSQLQuery("UPDATE weapons SET playerWeaponID9=? WHERE account=?", getPedWeapon(source,9), acc) executeSQLQuery("UPDATE weapons SET playerWeaponID10=? WHERE account=?", getPedWeapon(source,10), acc) executeSQLQuery("UPDATE weapons SET playerWeaponID11=? WHERE account=?", getPedWeapon(source,11), acc) executeSQLQuery("UPDATE weapons SET playerWeaponID12=? WHERE account=?", getPedWeapon(source,12), acc) --Wep Ammo executeSQLQuery("UPDATE weapons SET playerWeaponAmmo0=? WHERE account=?", getPedTotalAmmo(source, 0), acc) executeSQLQuery("UPDATE weapons SET playerWeaponAmmo1=? WHERE account=?", getPedTotalAmmo(source, 1), acc) executeSQLQuery("UPDATE weapons SET playerWeaponAmmo2=? WHERE account=?", getPedTotalAmmo(source, 2), acc) executeSQLQuery("UPDATE weapons SET playerWeaponAmmo3=? WHERE account=?", getPedTotalAmmo(source, 3), acc) executeSQLQuery("UPDATE weapons SET playerWeaponAmmo4=? WHERE account=?", getPedTotalAmmo(source, 4), acc) executeSQLQuery("UPDATE weapons SET playerWeaponAmmo5=? WHERE account=?", getPedTotalAmmo(source, 5), acc) executeSQLQuery("UPDATE weapons SET playerWeaponAmmo6=? WHERE account=?", getPedTotalAmmo(source, 6), acc) executeSQLQuery("UPDATE weapons SET playerWeaponAmmo7=? WHERE account=?", getPedTotalAmmo(source, 7), acc) executeSQLQuery("UPDATE weapons SET playerWeaponAmmo8=? WHERE account=?", getPedTotalAmmo(source, -- s8) -->, acc) executeSQLQuery("UPDATE weapons SET playerWeaponAmmo9=? WHERE account=?", getPedTotalAmmo(source, 9), acc) executeSQLQuery("UPDATE weapons SET playerWeaponAmmo10=? WHERE account=?", getPedTotalAmmo(source, 10), acc) executeSQLQuery("UPDATE weapons SET playerWeaponAmmo11=? WHERE account=?", getPedTotalAmmo(source, 11), acc) executeSQLQuery("UPDATE weapons SET playerWeaponAmmo12=? WHERE account=?", getPedTotalAmmo(source, 12), acc) --Wep Stats executeSQLQuery("UPDATE weapons SET pistolstat=? WHERE account=?", getPedStat(source,69), acc) executeSQLQuery("UPDATE weapons SET silencedstat=? WHERE account=?", getPedStat(source,70), acc) executeSQLQuery("UPDATE weapons SET desertstat=? WHERE account=?", getPedStat(source,71), acc) executeSQLQuery("UPDATE weapons SET shotgunstat=? WHERE account=?", getPedStat(source,72), acc) executeSQLQuery("UPDATE weapons SET sawnoffstat=? WHERE account=?", getPedStat(source,73), acc) executeSQLQuery("UPDATE weapons SET spazstat=? WHERE account=?", getPedStat(source,74), acc) executeSQLQuery("UPDATE weapons SET microstat=? WHERE account=?", getPedStat(source,75), acc) executeSQLQuery("UPDATE weapons SET mp5stat=? WHERE account=?", getPedStat(source,76), acc) executeSQLQuery("UPDATE weapons SET akstat=? WHERE account=?", getPedStat(source,77), acc) executeSQLQuery("UPDATE weapons SET m4stat=? WHERE account=?", getPedStat(source,78), acc) executeSQLQuery("UPDATE weapons SET sniperstat=? WHERE account=?", getPedStat(source,79), acc) --Players executeSQLQuery("UPDATE players SET skin=? WHERE account=?", getElementModel(source), acc) executeSQLQuery("UPDATE players SET x=? WHERE account=?", x, acc) executeSQLQuery("UPDATE players SET y=? WHERE account=?", y, acc) executeSQLQuery("UPDATE players SET z=? WHERE account=?", z, acc) executeSQLQuery("UPDATE players SET int=? WHERE account=?", getElementInterior(source), acc) executeSQLQuery("UPDATE players SET dim=? WHERE account=?", getElementDimension(source), acc) executeSQLQuery("UPDATE players SET wanted=? WHERE account=?", getPlayerWantedLevel(source), acc) executeSQLQuery("UPDATE players SET money=? WHERE account=?", getPlayerMoney(source), acc) executeSQLQuery("UPDATE players SET occupation=? WHERE account=?", getElementData(source, "Occupation"), acc) executeSQLQuery("UPDATE players SET team=? WHERE account=?", getTeamName(getPlayerTeam(source)), acc) end addEventHandler("onPlayerLogout", root, saveThings) I'm currently experiencing some problems with this script, it does update the weapons and weapons stats, but it doesn't update the players table... Please note, that this is only a part of the script, I didn't want to post the full code and there is no errors on debugscript.
  15. famma cashU fi tunis normalement, Od5el el hedhi w chouf tunisie ataw tal9a liste.
  16. Like playing it for a single person? try triggering it serversided. triggerClientEvent(element, "playTheSound", element)
  17. Use localPlayer instead of source. pizzasLeft = guiCreateLabel (590, 182, 195, 55, "PIZZAS LEFT: " .. getElementData (localPlayer, "pizzajob.pizzas"), false)
  18. Baseplate

    Turf system

    Use tables, you can make this code in 60 lines in place 500 lines.
×
×
  • Create New...