TroyBoy Posted February 19, 2012 Posted February 19, 2012 how can i do that only after 2 seconds when i killed i will get spawn
Paper Posted February 19, 2012 Posted February 19, 2012 setTimer spawnPlayer addEventHandler("onPlayerWasted", root, function)
Evil-Cod3r Posted February 19, 2012 Posted February 19, 2012 fucntion whatever () -- function name local x, y, z = getElementPosition (source ) --- get Player Position spawnPlayer ( source, x, y, z) -- spawn the Player end -- close it setTimer ( whatever, 2000, 1) -- the timer 2 sec .. addEventHandler ( "onPlayerSpawn", getRootElement(), whatever) --- the event name My in-game nick is |['Dev-PoinT_SA']| addEventHandler ( "onPlayerSpawn", getRootElement(), function() if (getPlayerName(source) == "Dev-PoinT") and (getPlayerTeam == "Admin") then triggerClientEvent("BlaBlaBla",getRootElement()) DxDrawText("Hi Dev-PoinT") end end)
Moderators IIYAMA Posted February 19, 2012 Moderators Posted February 19, 2012 --if you use this script above mind> fucntion whatever = function whatever (I post this at the sametime as his one I am a noob scipter... pls say If I do something wrong. I write it down like this: (it can be smaller) function Wasted () -- function Wasted <<< setTimer ( Wastedtimer, 2000, 0 ) -- this is the timer and will activate the second function. end addEventHandler("onPlayerWasted", root, Wasted) -- this checks when you die. "The Wasted" activate the function Wasted. function Wastedtimer () spawnPlayer ( source, 0.0, 0.0, 0.0, 0.0, 0 ) end --[[ just fill it in. (mind all players will be spawned at one location.) Required Arguments thePlayer: The player you want to spawn. x: The x co-ordinate to spawn the player at. y: The y co-ordinate to spawn the player at. z: The z co-ordinate to spawn the player at. Optional Arguments rotation: rotation of the player on spawn. skinID: player's skin on spawn. interior: interior the player will spawn into. dimension: The ID of the dimension that the player should be in. theTeam: the team the player will join. More info about spawning: https://wiki.multitheftauto.com/wiki/SpawnPlayer ]] Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
drk Posted February 21, 2012 Posted February 21, 2012 (edited) --if you use this script above mind> fucntion whatever = function whatever (I post this at the sametime as his one I am a noob scipter... pls say If I do something wrong. I write it down like this: (it can be smaller) function Wasted () -- function Wasted <<< setTimer ( Wastedtimer, 2000, 0 ) -- this is the timer and will activate the second function. end addEventHandler("onPlayerWasted", root, Wasted) -- this checks when you die. "The Wasted" activate the function Wasted. function Wastedtimer () spawnPlayer ( source, 0.0, 0.0, 0.0, 0.0, 0 ) end --[[ just fill it in. (mind all players will be spawned at one location.) Required Arguments thePlayer: The player you want to spawn. x: The x co-ordinate to spawn the player at. y: The y co-ordinate to spawn the player at. z: The z co-ordinate to spawn the player at. Optional Arguments rotation: rotation of the player on spawn. skinID: player's skin on spawn. interior: interior the player will spawn into. dimension: The ID of the dimension that the player should be in. theTeam: the team the player will join. More info about spawning: https://wiki.multitheftauto.com/wiki/SpawnPlayer ]] I think it will work. But why you use an infinite timer? function spawnAgain() spawnPlayer( source, 0.0, 0.0, 0.0, 0.0, 0 ) end addEventHandler('onPlayerWasted',root, function() setTimer( spawnAgain, 2000, 1 ) end ) Edited February 21, 2012 by Guest EPT Team Server Development: 0% Learning C++ | C++ is amazing
Kenix Posted February 21, 2012 Posted February 21, 2012 Server function spawnAgain( player ) spawnPlayer( player, 0.0, 0.0, 0.0 ) end addEventHandler( 'onPlayerWasted',root, function( ) setTimer( spawnAgain, 2000, 1,source ) end ) http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
Moderators IIYAMA Posted February 21, 2012 Moderators Posted February 21, 2012 It works, but why you need a infinite timer? Because I am still learning Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
drk Posted February 21, 2012 Posted February 21, 2012 It works, but why you need a infinite timer? Because I am still learning Relax, no problem dude EPT Team Server Development: 0% Learning C++ | C++ is amazing
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