Jump to content
RAGE Multiplayer Community

how to spawn vehicles?? or use a trainer


santosh
 Share

Recommended Posts

Hi, santosh.

You can send to the server a command `/spawncar` (for example) from your client side (you need to change a web part on the client side using this hack) when a user click to this buttons. And on the server you need to handle the command and spawn vehicles for users.

An example for handling clicks to `f1` and `t` buttons on the client in the web part:

<script>
  document.addEventListener('keydown', keyDownHandler, false);

  function keyDownHandler(e) {
    if(e.key === 'F1' || e.key === 't') {
    	mp.invoke('/spawncar');
    }
  }
</script>

Or you can use jquery for the handler. And you need to change/remove a bind to `t` button from the basic client side web part (`event.which == 84`).

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...