daKillar2000 Posted September 17, 2010 Posted September 17, 2010 hi i have a question how i can check howmuch a player have on his bank ..tostring(getElementData(lp,"money")) then he takes handmoney how i do for bank
dzek (varez) Posted September 17, 2010 Posted September 17, 2010 it depends what script you are using for bank..
dzek (varez) Posted September 17, 2010 Posted September 17, 2010 isnt it easier to open script and check whats inside? probably you have to do: getAccountData(account_variable, "bank.amout") or it was "bank.money"? I dont have it, just open this script and look inside..
daKillar2000 Posted September 17, 2010 Author Posted September 17, 2010 says now bank: false if i depos... money
dzek (varez) Posted September 17, 2010 Posted September 17, 2010 you didnt gave us any code. we don't know what you did. your "error message" is incomplete and you didnt say which line is causing that error. blablabla. Here: viewtopic.php?f=91&t=27027 probably you received this link already 20 times, but well, you still havent red it
daKillar2000 Posted September 17, 2010 Author Posted September 17, 2010 DaPlayerBank = guiCreateLabel(15, 138, 217, 15, "Bank:", false, PlayerinfoW) guiLabelSetHorizontalAlign(DaPlayerBank, "left", false) guiLabelSetVerticalAlign(DaPlayerBank, "center") guiSetText(DaPlayerBank,"Bank: $ " ..tostring(getElementData(lp,"bank.money")))
dzek (varez) Posted September 17, 2010 Posted September 17, 2010 oh my god. at least read my posts when i'm giving you direct answer. getAccountData, not getElementData. again - take a peek into bank resource. And i dont know why you are trying to re-create the gui?
dzek (varez) Posted September 17, 2010 Posted September 17, 2010 well, getAccountData is server side, so you have to trigger client side event.. just look inside 50p's resource! omg, that is my last reply to this topic, i have enough with your ignorance to any suggestions
daKillar2000 Posted September 17, 2010 Author Posted September 17, 2010 pardon i know if it serverside O_o
50p Posted September 18, 2010 Posted September 18, 2010 Bank resource has a number of exported functions, 2 of them are: setBankAccountBalance( player or accountName, newBalance ) getBankAccountBalance( player or accountName ) They are obviously server-side functions to be safer.
daKillar2000 Posted September 21, 2010 Author Posted September 21, 2010 -client side addEvent("banklabel", true ) function banklabel( ) bank = tonumber(balance) guiSetText(DaPlayerBank,"Bank: $ " ..tostring(thePlayer,balance)) end serverside function bankstatus (source) local account = getPlayerAccount (source); if not isGuestAccount(account) then local balance = getBankAccountBalance(source) triggerClientEvent (source,"banklabel",source,balance) end end
dzek (varez) Posted September 21, 2010 Posted September 21, 2010 these functions are exported functions. you can't just call them this way! i have never used exported functions but probably you need to use this: local something = call(getResourceFromName("bank"), "getBankAccountBalance", source) -- remember - source is player element or account name
50p Posted September 21, 2010 Posted September 21, 2010 ... local balance = exports.bank:getBankAccountBalance( source ) -- make sure source is player element or account name ... ... function banklabel( balance ) guiSetText(DaPlayerBank,"Bank: $ " ..tostring(balance)) ...
daKillar2000 Posted September 22, 2010 Author Posted September 22, 2010 ok i put that but not works again i do this: ----Serverside function bankstatus (source) local account = getPlayerAccount (source); local balance = exports.bank:getBankAccountBalance( source ) triggerClientEvent (source,"banklabel",source,balance) end -----ClientSide addEvent("banklabel", true ) function banklabel( balance ) guiSetText(DaPlayerBank,"Bank: $ " ..tostring(balance)) end I Dont Know Why Not Works
50p Posted September 22, 2010 Posted September 22, 2010 FIXED-------CLOSED------- What was wrong then? Tell us and then we can close the topic.
Castillo Posted September 23, 2010 Posted September 23, 2010 FIXED-------CLOSED------- What was wrong then? Tell us and then we can close the topic. i will tell us what was wrong since i had to fix it , he wasn't calling getstatus function that way it won't ever work, so i added a triggerServerEvent and now is working.
Castillo Posted September 23, 2010 Posted September 23, 2010 What getstatus function? My bad, was bankstatus
Recommended Posts