Sande Posted August 9, 2013 Share Posted August 9, 2013 I am made nordea command bank system, and this transfer command not work. No errors. please help. function tilisiirto ( thePlayer, target, command, amount ) local target = getPlayerFromName ( target ) if ( target ) then if not (isGuestAccount (getPlayerAccount (thePlayer))) then if (getAccountData (getPlayerAccount (thePlayer), "nordea-cash")) then if (getAccountData (getPlayerAccount (thePlayer), "nordea-cash") >= tonumber (amount)) and (tonumber (amount) > 0) then local money = (tonumber(getAccountData (getPlayerAccount (thePlayer), "nordea-cash")) - tonumber (amount)) setAccountData (getPlayerAccount (thePlayer), "nordea-cash", tonumber(money)) givePlayerMoney (target, tonumber(amount)) outputChatBox ( tostring (amount) .. "$ nostettu tililtä, ja annettu pelaajaalle "..(target)..".", thePlayer, 0, 255, 0, false) outputChatBox ( tostring (amount) .. "$ Antoi sinulle pelaaja "..getPlayerName(thePlayer)..".", target, 0,255,0) else outputChatBox ("[Nordea]Et voi siirtää enempää mitä sinulla pankkitilillä on!", thePlayer, 255, 0, 0, false) end else outputChatBox ("[Nordea]Käyttäjä luotu!", thePlayer, 255, 0, 0, false) outputChatBox ("[Nordea]Pankki antaa sinulle 250$ tervetulolahjaksi!", thePlayer, 255, 0, 0, false) setAccountData (getPlayerAccount (thePlayer), "nordea-cash", 250) end end end end addCommandHandler("siirto", tilisiirto ) Link to comment
DNL291 Posted August 9, 2013 Share Posted August 9, 2013 The 2nd parameter is the commandName. player playerSource, string commandName, [string arg1, string arg2, ...] Link to comment
Sande Posted August 9, 2013 Author Share Posted August 9, 2013 givePlayerMoney (target, commandName, tonumber(amount)) Not work, or i didnt understand. Please stuck it to the code. Link to comment
DNL291 Posted August 9, 2013 Share Posted August 9, 2013 function tilisiirto ( thePlayer, command, target, amount ) local target = getPlayerFromName ( target ) if ( target ) then if not (isGuestAccount (getPlayerAccount (thePlayer))) then if (getAccountData (getPlayerAccount (thePlayer), "nordea-cash")) then if (getAccountData (getPlayerAccount (thePlayer), "nordea-cash") >= tonumber (amount)) and (tonumber (amount) > 0) then local money = (tonumber(getAccountData (getPlayerAccount (thePlayer), "nordea-cash")) - tonumber (amount)) setAccountData (getPlayerAccount (thePlayer), "nordea-cash", tonumber(money)) givePlayerMoney (target, tonumber(amount)) outputChatBox ( tostring (amount) .. "$ nostettu tililtä, ja annettu pelaajaalle "..(target)..".", thePlayer, 0, 255, 0, false) outputChatBox ( tostring (amount) .. "$ Antoi sinulle pelaaja "..getPlayerName(thePlayer)..".", target, 0,255,0) else outputChatBox ("[Nordea]Et voi siirtää enempää mitä sinulla pankkitilillä on!", thePlayer, 255, 0, 0, false) end else outputChatBox ("[Nordea]Käyttäjä luotu!", thePlayer, 255, 0, 0, false) outputChatBox ("[Nordea]Pankki antaa sinulle 250$ tervetulolahjaksi!", thePlayer, 255, 0, 0, false) setAccountData (getPlayerAccount (thePlayer), "nordea-cash", 250) end end end end addCommandHandler("siirto", tilisiirto ) Try it. Link to comment
Sande Posted August 9, 2013 Author Share Posted August 9, 2013 ERROR: line 98, attempt to contacte local target a (userdata value) Link to comment
Vision Posted August 9, 2013 Share Posted August 9, 2013 function tilisiirto ( thePlayer, command, target, amount ) local target = getPlayerFromName ( target ) if ( target ) then if not (isGuestAccount (getPlayerAccount (thePlayer))) then if (getAccountData (getPlayerAccount (thePlayer), "nordea-cash")) then if (getAccountData (getPlayerAccount (thePlayer), "nordea-cash") >= tonumber (amount)) and (tonumber (amount) > 0) then local money = (tonumber(getAccountData (getPlayerAccount (thePlayer), "nordea-cash")) - tonumber (amount)) setAccountData (getPlayerAccount (thePlayer), "nordea-cash", tonumber(money)) givePlayerMoney (target, tonumber(amount)) outputChatBox ( tostring (amount) .. "$ nostettu tililtä, ja annettu pelaajaalle ".. getPlayerName ( target )..".", thePlayer, 0, 255, 0, false) outputChatBox ( tostring (amount) .. "$ Antoi sinulle pelaaja "..getPlayerName(thePlayer)..".", target, 0,255,0) else outputChatBox ("[Nordea]Et voi siirtää enempää mitä sinulla pankkitilillä on!", thePlayer, 255, 0, 0, false) end else outputChatBox ("[Nordea]Käyttäjä luotu!", thePlayer, 255, 0, 0, false) outputChatBox ("[Nordea]Pankki antaa sinulle 250$ tervetulolahjaksi!", thePlayer, 255, 0, 0, false) setAccountData (getPlayerAccount (thePlayer), "nordea-cash", 250) end end end end addCommandHandler("siirto", tilisiirto ) Try. Link to comment
Sande Posted August 9, 2013 Author Share Posted August 9, 2013 Working, but messages not working Link to comment
Sande Posted August 9, 2013 Author Share Posted August 9, 2013 I fixed it, no problem. THANKS! Link to comment
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