Bazoookaaa Posted December 15, 2011 Share Posted December 15, 2011 Hi i was trying to modified Al3grab´s resource to only the owner of the server can use the function of send money to all players but it gives me error it says: ERROR: money-all \ money-all.lua:15: "" expected near "(" i dont know what it means Heres my code (in server-side) : addCommandHandler ( "sa",send) function ( player, cmd, al3grab ) if isObjectInACLGroup ( "player" .. accountname, aclGetGroup ( "Console" )) then if tonumber ( al3grab ) ~= nil then for id, player in ipairs ( getElementsByType ( "player" ) ) do givePlayerMoney ( player, tonumber ( al3grab ) ) outputChatBox("#FF0000 *** ADMIN HAS GIVEN MONEY: #00FF00" .. al3grab .. "$ #FF0000 TO ALL PLAYERS *** ", root, 255,0,0,true) end end end end ) -- *** Script Code | Server-Side *** -- *** Fake Send Code | Server-Side *** function fsend ( player , cmd , fal3grab ) if isObjectInACLGroup ( "player" .. accountname, aclGetGroup ( "Console" )) then if tonumber ( fal3grab ) ~= nil then outputChatBox("#FF0000 *** ADMIN HAS GIVEN MONEY: #00FF00" .. fal3grab .. "$ #FF0000 TO ALL PLAYERS *** ", root, 255,0,0,true) end end end addCommandHandler ( "fsa",fsend) -- *** Fake Send Code | Server-Side *** -- *** End Of Script *** Plis help! Link to comment
BinSlayer1 Posted December 15, 2011 Share Posted December 15, 2011 addCommandHandler ( "sa", --problems here function ( player, cmd, al3grab ) local accountname = getAccountName(getPlayerAccount(player)) --you missed this if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Console" )) then --here if tonumber ( al3grab ) ~= nil then for id, player in ipairs ( getElementsByType ( "player" ) ) do givePlayerMoney ( player, tonumber ( al3grab ) ) end outputChatBox("#FF0000 *** ADMIN HAS GIVEN MONEY: #00FF00" .. al3grab .. "$ #FF0000 TO ALL PLAYERS *** ", root, 255,0,0,true) --and this is definitely not supposed to be in the For Loop end end end ) Link to comment
Bazoookaaa Posted December 15, 2011 Author Share Posted December 15, 2011 outputChatBox("#FF0000 *** ADMIN HAS GIVEN MONEY: #00FF00" .. al3grab .. "$ #FF0000 TO ALL PLAYERS *** ", root, 255,0,0,true) --and this is definitely not supposed to be in the For Loop Why dont supposed to be if its the message thats the admin send money? Link to comment
BinSlayer1 Posted December 15, 2011 Share Posted December 15, 2011 because it will be repeated x (number of players) times and it should be only shown ONCE to EVERYONE, meaning 'root'. Link to comment
Bazoookaaa Posted December 15, 2011 Author Share Posted December 15, 2011 Ok im very noob in this stuff ^^ thanks very much 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