Jump to content

Drakath

Members
  • Posts

    768
  • Joined

  • Last visited

Everything posted by Drakath

  1. local accName = getAccountName ( getPlayerAccount ( p ) ) Bad argument @ 'getAccountName' [Expected account at argument 1, got boolean] attempt to concatenate local 'accName' (a boolean value) How is it possible that getPlayerAccount returns false and how can I fix it?
  2. When I'm driving a car sometimes it suddenly stops for a very short time but the speed becomes 0 so I have to gather momentum again. Is it caused by Server lag or is it something else?
  3. Drakath

    Money

    Client: function lol () triggerServerEvent("givemoney", localPlayer, 400) end addEventHandler ( "onClientGUIClick", lolz, lol ) Server: function givecash ( thePlayer, amount ) givePlayerMoney ( thePlayer, amount ) end addEvent("givemoney", true) addEventHandler("givemoney", root, givecash) Warning: Bad argument @ 'givePlayerMoney'
  4. Drakath

    Money

    What's wrong with clientside money? I use clientside 'givePlayerMoney' but my save system is serverside and it does not save the money gotten from client side, why?
  5. Well, I received "cost or money do not exist." output a few times but at least there are no more errors. Thanks.
  6. I tried debugging it with: outputChatBox ( tostring ( cost ) ) But all results outputted a number just like tonumber(cost) I'm not sure how do players manage to make this error. Also when I added this line: if not tonumber(cost) == nil then I couldn't buy it anymore.
  7. attempt to compare nil with number if (tonumber(getPlayerMoney (source)) >= tonumber(cost)) then Is it possible that money can be nil? Or is it the cost that is nil?
  8. Drakath

    Logs

    Would it save any ram if I would disable server_auth.log?
  9. Drakath

    Logs

    Why does the server.log logs the logins? There is server_auth.log that does the same thing, so why waste ram? My suggestion is for server.log to stop log the logins.
  10. TAPL's method worked. Thanks.
  11. So, I'm making a Speedometer script and I keep getting this error: "addEventHandler: 'onClientRender' with this function is already handled" function speed ( ) addEventHandler ( "onClientRender", root, draw ) end addEventHandler ("onClientVehicleEnter", root, speed) function hideSpeed ( ) removeEventHandler ( "onClientRender", root, draw ) end addEventHandler("onClientVehicleExit", root, hideSpeed) function draw ( ) --this is where I have dxdraw stuff. end
  12. Drakath

    Garage id

    2644.6643066406, -2038.6875, 13.550000190735
  13. Drakath

    Garage id

    This doesn't help me, I still don't know which is the garage of Loco Low Co. in Los Santos.
  14. Drakath

    Garage id

    What is the garage ID of Loco Low Co. in Los Santos?
  15. Drakath

    Garage id

    What is the garage ID of Loco Low Co. in Los Santos?
  16. Drakath

    tables

    Seems like it worked. Thank you all for helping
  17. Drakath

    tables

    It worked, but when I upgraded again, I lose the old upgrades. I tried this: addEvent( "modShop_playerLeaveModShop", true ) addEventHandler( "modShop_playerLeaveModShop", getRootElement( ), function( vehicle, itemsCost, upgrades, colors, paintjob, shopName ) local pMoney = getPlayerMoney( source ) local account = getPlayerAccount(source) if pMoney >= itemsCost and account then modTheVehicle( vehicle, upgrades, colors, paintjob, shopName ) takePlayerMoney( source, itemsCost ) triggerClientEvent( source, "modShop_moddingConfirmed", source ) local data = getAccountData (getPlayerAccount(source), "cu") local calculatedData = fromJSON ( data ) local myTable = {} for i, ups in ipairs (upgrades) do table.insert ( myTable, ups ) table.insert ( myTable, calculatedData ) end setAccountData (account, "cu",toJSON (myTable)) else outputChatBox( "#FF0000Inufficient founds! #00FF00Your pocket shows $"..tostring( getPlayerMoney( source ) )..".#FFFFFF Uninstall some upgrades.", source, 0,0,0,true) end end ) But it didn't work. Between, what does 'ups' stand for?
  18. Drakath

    tables

    I had upgrade 1010. I upgraded two items: hydraulics and wheels. However only the first item (hydraulics) have been saved. Also I have lost upgrade 1010. addEvent( "modShop_playerLeaveModShop", true ) addEventHandler( "modShop_playerLeaveModShop", getRootElement( ), function( vehicle, itemsCost, upgrades, colors, paintjob, shopName ) local pMoney = getPlayerMoney( source ) local account = getPlayerAccount(source) if pMoney >= itemsCost and account then modTheVehicle( vehicle, upgrades, colors, paintjob, shopName ) takePlayerMoney( source, itemsCost ) triggerClientEvent( source, "modShop_moddingConfirmed", source ) local data = getAccountData (getPlayerAccount(source), "cu") local myTable = {} table.insert ( myTable, data ) table.insert ( myTable, upgrades ) setAccountData (account, "cu",toJSON (myTable)) outputChatBox( "Upgrades: "..upgrades, source, 0,0,0,true) else outputChatBox( "#FF0000Inufficient founds! #00FF00Your pocket shows $"..tostring( getPlayerMoney( source ) )..".#FFFFFF Uninstall some upgrades.", source, 0,0,0,true) end end )
  19. Drakath

    tables

    I only need to unpack one table which is: 'upgrades'.
  20. Drakath

    tables

    I don't want to make account data for every vehicle upgrade because it would spam the database. Anyway the problem is that it doesn't save any upgrades. It works if I put: table.insert ( myTable, 1010 ) but not when I put: table.insert ( myTable, upgs ) which means something is wrong with upgs.
  21. Drakath

    tables

    Oh, one last, last thing. I downloaded modshop resource form community and I modified one part to setAccountData for the vehicle. addEvent( "modShop_playerLeaveModShop", true ) addEventHandler( "modShop_playerLeaveModShop", getRootElement( ), function( vehicle, itemsCost, upgrades, colors, paintjob, shopName ) local pMoney = getPlayerMoney( source ) if pMoney >= itemsCost then modTheVehicle( vehicle, upgrades, colors, paintjob, shopName ) takePlayerMoney( source, itemsCost ) triggerClientEvent( source, "modShop_moddingConfirmed", source ) local upgs = unpack(upgrades) local account = getPlayerAccount(source) local myTable = {} if account then table.insert ( myTable, upgs ) setAccountData (account, "cu",toJSON (myTable)) else outputChatBox( "#FF0000Inufficient founds! #00FF00Your pocket shows $"..tostring( getPlayerMoney( source ) )..".#FFFFFF Uninstall some upgrades.", source, 0,0,0,true) end end end ) But it kind of messes up the account data and end up with bad argument 'addVehicleUpgrade'. I tried unpacking the table to insert the ids, but it didn't work. My account data was something like this: [ [ "[ [ \"[ [ \\\"[ [ \\\\\\\"[ [ \\\\\\\\\\\\\\\"[ [ 1008 ] ]\\\\\\\\\\\\\\\", 1008 ] ]\\\\\\\", 1010 ] ]\\\", [ 1087, 1073 ]
  22. if not getVehicleOccupants(getElementData (source, "car")) == 0 then Bad argument @ 'getVehicleOccupants' What's wrong?
×
×
  • Create New...