Jump to content

[Help]Trigger action cmd


Nich

Recommended Posts

Hello!

I made a suicide script and want to toggle action cmd /me every time some one commits a suicide.

E.g, /me commited a suicide - every one sees "John_Doe commited a suicide"

How could i do that?

And second thing I wanted to ask if it is possible to make the time between deaths and spawning longer? Like in SP, camera moves away from the player and then respawns. ATM, my man respawns with like milliseconds. :P

Link to comment

Simple answer: yes, you can. Add an outputChatBox line to the command handler function for your command. You can look up its parameters on the wiki.

The second is also perfectly possible; unfortunately, it's really difficult to say how, when you give no info at all about which scripts you're actually using.

Link to comment

There's nothing much to say, because I just started scripting it. So, there's pretty much nothing related to deaths, exept for /suicide.(setElementHealth 0.. is there a better function for that?)

It would be a great addition, but I'm making a hospital system anyways..

Link to comment
Hello!

I made a suicide script and want to toggle action cmd /me every time some one commits a suicide.

E.g, /me commited a suicide - every one sees "John_Doe commited a suicide"

How could i do that?

And second thing I wanted to ask if it is possible to make the time between deaths and spawning longer? Like in SP, camera moves away from the player and then respawns. ATM, my man respawns with like milliseconds. :P

1. There are 2 ways.

a) Make a command /me and than use executeCommandHandler in onPlayerWasted event handler.

b) outputChatBox ( getPlayerName( source ) .. " committed a suicide" ); in onPlayerWasted event handler.

2. Add a timer in onPlayerWasted event handler:

setTimer( spawnPlayer, 5000, 1, source, X, Y, Z ); -- where X, Y, Z is spawn position. 5000 = seconds

Make sure other resources don't spawn players when they die.

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