Jump to content

Can you help me?


iGermaN

Recommended Posts

First, sorry for my English, I'm brazilian.

 

I'm beggining in the world of MTA scriptingxD

I want to create a race script, but I'm not know how to get  the second player name, money, etc.

How would the outputChatBox for the second player?

This script has begin with this command for example:  /race playername (to invite an other player to race.)

 

local pName = getPlayerName(source)
-- local sName = getPlayerName() <- The second player name
local pMoney = getPlayerMoney(source)
-- local sMoney = getPlayerMoney() <- The second player money

 

Link to comment

An example: 

function hello( player, _, toPlayer )
  if not isElement( player ) then return end 
  if not isElement( toPlayer ) then return end 
  local playerName = getPlayerFromName( toPlayer )
  if ( playerName ) then 
    outputChatBox("["..getPlayerName( player ).."] Hi!", playerName)
    
  end 
end 
addCommandHandler("hi", hello)

 

Link to comment

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