liamknight24 Posted February 6, 2010 Share Posted February 6, 2010 how can i make a script that will write a car position to XML when the player types in a command? and how do i compile scripts, and is there any point? Link to comment
50p Posted February 6, 2010 Share Posted February 6, 2010 If you know how xml file looks (what's inside) then you shouldn't have any problems with saving car's position in an xml file. You know how to add commands and get vehicle's position. All you need to do is create or load an xml file, add a node and store vehicle's position in the new node's attributes. Why don't you read wiki or the basics tutorial? Link to comment
liamknight24 Posted February 7, 2010 Author Share Posted February 7, 2010 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. Link to comment
50p Posted February 7, 2010 Share Posted February 7, 2010 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. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now