Jump to content

Chat Command Actions


DarkOrbit
 Share

Recommended Posts

Hi everyone,

I am just getting started on setting up to mod Renegade X. I downloaded the SDK and have been going through looking at all the cool things and source files. I was wondering if there was an easy way to trigger something to happen when a player types a chat command - sort of like the way various Renegade servers had. For starters I just want to play around with different commands and actions to see what I can do, but is there anyone who might be able to point me in the right direction on where this might be or how I would be able to set it up? Example: A player types !sniper and if the player has 500 credits, the player is given a sniper and deducted 500 credits.

Any help is appreciated :)

Link to comment
Share on other sites

You can trigger the action you want by setting up a Rcon bot which would handle the command and then send a Rcon to the server. The dirty way would be to create an empty console variable that would take following format

 setchar [playerName] [charName] 

Your script code would monitor that variable for any changes every 10 miliseconds. When a player types !sniper in chat the bot would handle that message and send the command setchar examplePlayerName sniper to the server. After that your script would make the proper action and clear the variable.

This is again the dirty way of achieving that and perhaps there are much better, cleaner methods but to learn them you have to read the UE3 scripting reference yourself. I don't have any experience with UnrealScript nor the engine. Maybe it allows you to register a console event that would call the function only when needed.

Link to comment
Share on other sites

Hmm okay. I was wondering if there was a way using Mutators to somehow "check" the text a player is going to send before he sends it, and then if the text contains, for example, "!sniper" then the code could perform additional actions (such as giving the player the sniper and deducting credits). This is assuming there is already a place where the message a player is trying to send can be retrieved - but I am assuming since there is a private chat function that there must be a way to somehow manipulate that.

Link to comment
Share on other sites

You can google for the "mutate" console command. The mutate command sends a message to all mutators on the server and they can react to it. So you could do something like "mutate sniper" and have a mutator give you a sniper then.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...