daKillar2000 Posted September 17, 2010 Share 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 Link to comment
dzek (varez) Posted September 17, 2010 Share Posted September 17, 2010 it depends what script you are using for bank.. Link to comment
daKillar2000 Posted September 17, 2010 Author Share Posted September 17, 2010 i have normally 50p bank Link to comment
dzek (varez) Posted September 17, 2010 Share 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.. Link to comment
daKillar2000 Posted September 17, 2010 Author Share Posted September 17, 2010 says now bank: false if i depos... money Link to comment
daKillar2000 Posted September 17, 2010 Author Share Posted September 17, 2010 how i fix it? Link to comment
dzek (varez) Posted September 17, 2010 Share 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 Link to comment
daKillar2000 Posted September 17, 2010 Author Share 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"))) Link to comment
dzek (varez) Posted September 17, 2010 Share 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? Link to comment
daKillar2000 Posted September 17, 2010 Author Share Posted September 17, 2010 lol thats not works Link to comment
dzek (varez) Posted September 17, 2010 Share 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 Link to comment
daKillar2000 Posted September 17, 2010 Author Share Posted September 17, 2010 pardon i know if it serverside O_o Link to comment
50p Posted September 18, 2010 Share 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. Link to comment
daKillar2000 Posted September 21, 2010 Author Share 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 Link to comment
dzek (varez) Posted September 21, 2010 Share 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 Link to comment
daKillar2000 Posted September 21, 2010 Author Share Posted September 21, 2010 not works Link to comment
50p Posted September 21, 2010 Share 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)) ... Link to comment
daKillar2000 Posted September 22, 2010 Author Share 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 Link to comment
daKillar2000 Posted September 22, 2010 Author Share Posted September 22, 2010 FIXED -------CLOSED------- Link to comment
50p Posted September 22, 2010 Share Posted September 22, 2010 FIXED-------CLOSED------- What was wrong then? Tell us and then we can close the topic. Link to comment
Castillo Posted September 23, 2010 Share 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. Link to comment
50p Posted September 23, 2010 Share Posted September 23, 2010 What getstatus function? Link to comment
Castillo Posted September 23, 2010 Share Posted September 23, 2010 What getstatus function? My bad, was bankstatus Link to comment
50p Posted September 23, 2010 Share Posted September 23, 2010 Right... Locking the topic. Link to comment
Recommended Posts