Jump to content

givemoney function


Recommended Posts

Posted

Your code has much things that make totally no sense and some that are not needed. And he might not be using array indexes as player IDs but other thing.

Posted
Sorry but I'm not english and I don't understand good.

I read this in another resource:

local player, name = exports.players:getFromName( thePlayer, victim ) 

give me link this resource

Posted
Your code has much things that make totally no sense and some that are not needed. And he might not be using array indexes as player IDs but other thing.

I'd expect that he wants it

Posted
Sorry but I'm not english and I don't understand good.

I read this in another resource:

local player, name = exports.players:getFromName( thePlayer, victim ) 

give me link this resource

I use the MTA Paradise gamemode.

Posted

Use this function get a player from its ID:

function getPlayerByID ( theID ) 
    local playerFound = false 
    for _, player in ipairs ( getElementsByType ( "player" ) ) do 
        if ( exports.players:getID ( player ) == theID ) then 
            playerFound = player 
            break 
        end 
    end 
  
    return playerFound 
end 

Posted
Use this function get a player from its ID:
function getPlayerByID ( theID ) 
    local playerFound = false 
    for _, player in ipairs ( getElementsByType ( "player" ) ) do 
        if ( exports.players:getID ( player ) == theID ) then 
            playerFound = player 
            break 
        end 
    end 
  
    return playerFound 
end 

Can I have the complete function to this command: "/givemoney [playerid/partofname] [amount]"?

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...