Jump to content

Help with XML


liamknight24

Recommended Posts

Posted

cheers 50p.

anybody know why this dosent work ? ..

outputChatBox (  getPlayerName ( source )..  "has invited" .. otherplayer .. " to their team"   "("..getPlayerTeam ( source )..")", otherplayer )

-- i want it to come out like this:

"player" has invited "the other player" to their team (teamname)

and only let the player from the command see it, i think the rest of the script is fine but something is messed up with this.

Posted

source is not available in command handlers and I guess you didn't set it as parameter for function that is called by command.

addCommandHandler( "invite",
function( playerWhoTypedCommand, command, otherPlayersName )
local otherPlayer = getPlayerFromName( otherPlayersName );
if ( otherPlayer ) then -- check if such player is online
outputChatBox (  getPlayerName ( playerWhoTypedCommand )..  " has invited " .. otherPlayersName .. " to their team "   "(".. getTeamName( getPlayerTeam ( playerWhoTypedCommand ) ) ..")", otherPlayer )
outputChatBox ( "Invitation sent.", playerWhoTypedCommand );
else
outputChatBox ( "Player '".. otherPlayersName .. "' is not online.", playerWhoTypedCommand );
end
end
)

Advice: Learn from other scripts and use wiki, don't just copy'n'paste, otherwise you'll never know how to script.

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