Nich Posted October 18, 2009 Posted October 18, 2009 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.
robhol Posted October 18, 2009 Posted October 18, 2009 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. Do NOT PM ME for help unless invited. - New MTA Script Editor Scripting help "etiquette": understandable language, relevant code (ALL code if unsure), [Lua] tags, error messages with line numbers. Super simple stuff.
Nich Posted October 18, 2009 Author Posted October 18, 2009 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..
50p Posted October 18, 2009 Posted October 18, 2009 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. 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. - MTA Script Editor - Ask your scripting questions properly, please. - 50p's public resources - Meta.xml - what is it for? How is it possible LOL
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