Whizz Posted September 17, 2023 Share Posted September 17, 2023 Hello friends. I don't remember OnPlayerWasted, can anyone help? function start (thePlayer) local x, y, z = getElementPosition(thePlayer) local spawn = math.random(1, 3) if getPlayerMoney (thePlayer) >=0 then if (getDistanceBetweenPoints3D(x, y, z,)) < 5 then if spawn == 1 then end if spawn == 2 then end if spawn == 3 then end else outputChatBox("", thePlayer, 255, 0, 0) end else outputChatBox("", thePlayer, 0, 255, 255) end end addCommandHandler("play", start) Link to comment
FLUSHBICEPS Posted September 17, 2023 Share Posted September 17, 2023 Can you describe the issue? Why you need onPlayerWasted? getDistanceBetweenPoints3D is missing the target coordinates outputChatBox functions are missing messages to display to the player spawn points for the condition are not defined Link to comment
Whizz Posted September 17, 2023 Author Share Posted September 17, 2023 Players will return to Spawn 1,2,3 after dying matchmarker = createMarker(1518.0277099609 , -1138.9915771484 , 140.93536376953,"cylinder", 1, 255, 0, 0) function start (thePlayer) local x, y, z = getElementPosition(thePlayer) local spawn = math.random(1, 3) getPlayerTeam(thePlayer) setPlayerTeam(thePlayer, *) if getPlayerMoney (thePlayer) >=0 then if (getDistanceBetweenPoints3D(x, y, z, 1518.0277099609 , -1138.9915771484 , 140.93536376953)) < 5 then if spawn == 1 then end if spawn == 2 then end if spawn == 3 then end else outputChatBox("You're not in the marker.", thePlayer, 255, 0, 0) end else outputChatBox("Your Not Money", thePlayer, 0, 255, 255) end end addCommandHandler("play", start) --------------------------------------------------------------------------------------------- getDistanceBetweenPoints3D I used it to get the player to be in the marker and use the command. Link to comment
alex17" Posted September 17, 2023 Share Posted September 17, 2023 addEventHandler("onPlayerWasted", root, function() local spawn = math.random(1, 3) local team = getPlayerTeam(source) local skin = getElementModel(source) if spawn == 1 then spawnPlayer(source, x, y, z, math.random(0, 360), skin, 0, 0, team) elseif spawn == 2 then spawnPlayer(source, x, y, z, math.random(0, 360), skin, 0, 0, team) elseif spawn == 3 then spawnPlayer(source, x, y, z, math.random(0, 360), skin, 0, 0, team) end end ) x, y , z change them to the spawn coordinates Link to comment
Whizz Posted September 19, 2023 Author Share Posted September 19, 2023 I really appreciate it and it worked right! youre doing great . But there is one more question how do I get a timer for this project. Link to comment
alex17" Posted September 19, 2023 Share Posted September 19, 2023 2 hours ago, Commonist said: I really appreciate it and it worked right! youre doing great . But there is one more question how do I get a timer for this project. addEventHandler("onPlayerWasted", root, function() local spawn = math.random(1, 3) local team = getPlayerTeam(source) local skin = getElementModel(source) local player = source if spawn == 1 then setTimer(spawnPlayer, 3000, 1, player, x, y, z, math.random(0, 360), skin, 0, 0, team) elseif spawn == 2 then setTimer(spawnPlayer, 3000, 1, player, x, y, z, math.random(0, 360), skin, 0, 0, team) elseif spawn == 3 then setTimer(spawnPlayer, 3000, 1, player, x, y, z, math.random(0, 360), skin, 0, 0, team) end end ) 1 Link to comment
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