Sande Posted August 8, 2013 Posted August 8, 2013 Im so tired and angry when i try make these little codes works so can someone finish it. function ostaLippu ( thePlayer, myyja ) if getPlayerMoney(thePlayer) < 4000 then outputChatBox("Sinulla ei ole tarpeeksi rahaa ostaaksesi sisaanpaasya vlackin clubille.", thePlayer, 255, 0, 0) return end outputChatBox("[CLUB] Ostit lipukkeen vlackin clubiin!", thePlayer, 0,255,0) takePlayerMoney(thePlayer, 4000) --[[ Need to add if someone buy ticket, money goes to accountname vlack --]] end addCommandHandler("lippu", ostaLippu ) function setMoney(thePlayer,key,amount) --[[ Bank deposit --]] takePlayerMoney (thePlayer,amount) local account = getPlayerAccount(thePlayer) if account and tonumber(amount) then setAccountData(account,"nordea-cash",amount) outputChatBox("[NORDEA] Pistit tilillesi rahaa", thePlayer, 0,255,0) end end addCommandHandler("pano",setMoney) function nosta(thePlayer,key,amount) --[[ Bank withdraw --]] local playerMoney = getAccountData(playerAccount, "nordea-cash") if (playerMoney) then givePlayerMoney(thePlayer, amount ) outputChatBox("[NORDEA] Nostit tililtäsi rahaa", thePlayer, 0,255,0) end end addCommandHandler("nosto", nosta )
manve1 Posted August 8, 2013 Posted August 8, 2013 Im so tired and angry when i try make these little codes works so can someone finish it. That doesn't explain what your problem is...
Sande Posted August 8, 2013 Author Posted August 8, 2013 I try much times get these codes work, but .... not working.
manve1 Posted August 8, 2013 Posted August 8, 2013 Does debugscript 3 say anything? or do you suspect somewhere what might make the code fail?
Sande Posted August 8, 2013 Author Posted August 8, 2013 No errors, bank withdraw just not working. And ticket buying not give to money ACC name vlack. Becauce i dont have anything in my mind.
golanu21 Posted August 8, 2013 Posted August 8, 2013 takePlayerMoney (thePlayer,amount) for the example "amount" is not definited...
xXMADEXx Posted August 8, 2013 Posted August 8, 2013 takePlayerMoney (thePlayer,amount) for the example "amount" is not definited... It is defined. function setMoney(thePlayer,key,amount) --[[ Bank deposit --]] function nosta(thePlayer,key,amount) --[[ Bank withdraw --]]
Sande Posted August 8, 2013 Author Posted August 8, 2013 Now i got something in my mind, now only withdraw, and saldo check not work. It says something bad in getaccount data can someone fix please? function ostaLippu ( thePlayer, myyja ) if getPlayerMoney(thePlayer) < 4000 then outputChatBox("Sinulla ei ole tarpeeksi rahaa ostaaksesi sisaanpaasya vlackin clubille.", thePlayer, 255, 0, 0) return end outputChatBox("[CLUB] Ostit lipukkeen vlackin clubiin!", thePlayer, 0,255,0) takePlayerMoney(thePlayer, 4000) givePlayerMoney (getPlayerFromName("Vlack"), 4000) outputChatBox("[CLUB-MANAGER] Pelaaja "..getPlayerName(thePlayer).." osti lipun.", getPlayerFromName("Vlack"), 0,255,0) end addCommandHandler("lippu", ostaLippu ) function setMoney(thePlayer,key,amount) --[[ Bank deposit --]] takePlayerMoney (thePlayer,amount) local account = getPlayerAccount(thePlayer) if account and tonumber(amount) then setAccountData(account,"nordea-cash",amount) outputChatBox("[NORDEA] Pistit tilillesi rahaa "..(amount).."$", thePlayer, 0,255,0) end end addCommandHandler("pano",setMoney) function nosta(thePlayer,key,amount) --[[ Bank withdraw --]] local cash = getAccountData(thePlayer, "nordea-cash",amount) if (cash) then givePlayerMoney(thePlayer, amount ) outputChatBox("[NORDEA] Nostit tililtäsi rahaa: "..(amount).."$", thePlayer, 0,255,0) end end addCommandHandler("nosto", nosta ) function saldo(thePlayer,key,amount) --[[ Bank withdraw --]] local cash = getAccountData(thePlayer, "nordea-cash",amount) if (cash) then outputChatBox("[NORDEA] Sinulla on tililläsi "..(amount).."$", thePlayer, 0,255,0) end end addCommandHandler("saldo", saldo)
golanu21 Posted August 8, 2013 Posted August 8, 2013 try to make a database for it is more simple with database
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now