kalitonchik Posted March 3, 2009 Posted March 3, 2009 how to make a script, who performs this function when the player dies his death is shown in slow motion I assume that this is related to - onPlayerWasted/got killed event and I do not know the syntax of this function function player_Wasted (whot i need write here) if ( player_Wasted ) then ### show slow motion 2x with a period of two seconds addEventHandler ( "onPlayerWasted", XXXXXX, player_Wasted ) how to do it and in general, how to create a good script in note pad which does not show errors in syntax (what a pity...) and lua language in school does not teach ( we teach ''borland delphi'' ) alone I will not be able to learn lua ( because I have little time - Training (I am the master of sports gymnastics)
Gamesnert Posted March 3, 2009 Posted March 3, 2009 http://development.mtasa.com/index.php? ... tGameSpeed
kalitonchik Posted March 4, 2009 Author Posted March 4, 2009 yes.... and how it should look like, and whot i lost? function player_Wasted () if ( player_Wasted ) then setGameSpeed ( tonumber ( 1 ) ) end addCommandHandler ( "onPlayerWasted", getRootElement(), setgamespeed )
robhol Posted March 4, 2009 Posted March 4, 2009 Sigh... back to the basics. In these four lines of code, you've already managed to make 4 major mistakes. Read the scripting intro again. I suppose what you want to do is something like this: addEventHandler("onClientPlayerWasted", getLocalPlayer(), function () setGameSpeed(???) end ) I'm not sure what's the default value for setGameSpeed, you'll have to figure that out.
Ace_Gambit Posted March 4, 2009 Posted March 4, 2009 Let me help you a out a little bit. But please don't take this for granted and learn to understand. -- client script function onPlayerWasted() if (source == getLocalPlayer()) then setGameSpeed(0.15) setTimer(setGameSpeed, 5000, 1, 1) end end addEventHandler("onClientPlayerWasted", getRootElement(), onPlayerWasted, true)
kalitonchik Posted March 4, 2009 Author Posted March 4, 2009 my respect for your help where can download lua program is this program free? http://www.lua.org/download.html
eAi Posted March 10, 2009 Posted March 10, 2009 Changing the game speed on one client risks screwing up sync - be careful
Scarface Posted March 10, 2009 Posted March 10, 2009 *Scarface slaps LordAzamth Yes it's free But in my opinion Notepad++ is better.
darkdreamingdan Posted March 10, 2009 Posted March 10, 2009 You don't want to download the Lua interpreter to script. Get Notepad++
kalitonchik Posted March 10, 2009 Author Posted March 10, 2009 normal notepad does not check for errors in syntax
Gamesnert Posted March 10, 2009 Posted March 10, 2009 ... Get Notepad++ He didn't say this for nothing you know...
eAi Posted March 10, 2009 Posted March 10, 2009 normal notepad does not check for errors in syntax There is no editor that will check for syntax errors. Notepad++ highlights you code, which helps to some degree. Running your code with MTA will check for syntax errors.
darkdreamingdan Posted March 11, 2009 Posted March 11, 2009 Actually LuaEdit has a syntax checker built in. But i never liked LuaEdit it's not very nice to use. Personally i have a syntax check hook using Notepad++'s run option which launches the interpreter.
Smallo Posted March 11, 2009 Posted March 11, 2009 Changing the game speed on one client risks screwing up sync - be careful unless he makes the respawn time say 10 seconds and only does the slowmo for 5.
eAi Posted March 15, 2009 Posted March 15, 2009 The game speed will affect anything you're syncing. So, it'll cause any stationary vehicles you're syncing (or vehicles you've just exited) to apparently 'stutter' for other people. It could potentially cause other sync issues...
darkdreamingdan Posted March 15, 2009 Posted March 15, 2009 Desyncing gamespeed isnt a big deal. You can get away with it as long as you dont do it during gameplay. A slow-mo after death shouldnt have any major sync issues. If you look at maps such as as-sharks it uses desynced gamespeed to make some players faster than others and it doesnt have any overly adverse effects.
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