Jump to content

Send Money to all Players


Bazoookaaa

Recommended Posts

Posted

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! :(:(

Posted
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 
) 

Posted
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?

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...