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.

"[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007

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

Welcom to my server Q.5

Current game type in my server Drift

350x20_FFFFFF_FFFFFF_000000_000000.png

my Email : [email protected]

Programming level: 90%

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

Welcom to my server Q.5

Current game type in my server Drift

350x20_FFFFFF_FFFFFF_000000_000000.png

my Email : [email protected]

Programming level: 90%

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 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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]"?

Posted

You can try to make it, if it doesn't work, then I can help you with it.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Because you have to learn and do it by yourself. We aren't here for doing things for you, but to help you solving issues in your scripts.

"[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007

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