~SOV~DHooser15 Posted January 11, 2010 Share Posted January 11, 2010 How can i make it so you dont spawn in Tierra Robada, so you can pick where you want at enter of server and when wasted respawn where you died? Im not much of a noob i run a amazing server thats just one of the thigns i need, help would be amazing Link to comment
~SOV~DHooser15 Posted January 11, 2010 Author Share Posted January 11, 2010 How can i make it so you dont spawn in Tierra Robada, so you can pick where you want at enter of server and when wasted respawn where you died? Im not much of a noob i run a amazing server thats just one of the thigns i need, help would be amazing Link to comment
Gamesnert Posted January 11, 2010 Share Posted January 11, 2010 For that, you should either edit the "Play" resource, or make a new resource instead. You can slightly modify the example here to make what you want to make. Link to comment
Gamesnert Posted January 11, 2010 Share Posted January 11, 2010 For that, you should either edit the "Play" resource, or make a new resource instead. You can slightly modify the example here to make what you want to make. Link to comment
~SOV~DHooser15 Posted January 11, 2010 Author Share Posted January 11, 2010 Well here is it. addEventHandler("onResourceStart", resourceRoot, function() for i,player in ipairs(getElementsByType("player")) do spawn(player) end end ) function spawn(player) repeat until spawnPlayer ( player, -711+math.random(1,5), 957+math.random(5,9), 12.4, 90, math.random(9,288) ) fadeCamera(player, true) setCameraTarget(player, player) end addEventHandler("onPlayerJoin", root, function() spawn(source) end ) addEventHandler("onPlayerWasted", root, function() setTimer(spawn, 1800, 1, source) end ) Do you think you could tell me what to edit? I've tryed multiple times. Link to comment
~SOV~DHooser15 Posted January 11, 2010 Author Share Posted January 11, 2010 Well here is it. addEventHandler("onResourceStart", resourceRoot, function() for i,player in ipairs(getElementsByType("player")) do spawn(player) end end) function spawn(player) repeat until spawnPlayer ( player, -711+math.random(1,5), 957+math.random(5,9), 12.4, 90, math.random(9,288) ) fadeCamera(player, true) setCameraTarget(player, player)end addEventHandler("onPlayerJoin", root, function() spawn(source) end) addEventHandler("onPlayerWasted", root, function() setTimer(spawn, 1800, 1, source) end) Do you think you could tell me what to edit? I've tryed multiple times. Link to comment
Chusmadones Posted January 12, 2010 Share Posted January 12, 2010 function playerDied( ammo, attacker, weapon, bodypart ) gDiedX, gDiedY, gDiedZ= getElementPosition(source) -- We save wheres he/she dies end addEventHandler("onPlayerWasted", getRootElement(), playerDied) You need to research more at the wiki. You can edit the arguments in spawnPlayer( player, -711+math.random(1,5), 957+math.random(5,9), 12.4, 90, math.random(9,288) ) and set the arguments what you need. Example: You can set there the players pos in the last death IF he/she died. (x=blue, y=green, z=red) https://wiki.multitheftauto.com/wiki/SpawnPlayer Link to comment
Chusmadones Posted January 12, 2010 Share Posted January 12, 2010 function playerDied( ammo, attacker, weapon, bodypart ) gDiedX, gDiedY, gDiedZ= getElementPosition(source) -- We save wheres he/she dies end addEventHandler("onPlayerWasted", getRootElement(), playerDied) You need to research more at the wiki. You can edit the arguments in spawnPlayer( player, -711+math.random(1,5), 957+math.random(5,9), 12.4, 90, math.random(9,288) ) and set the arguments what you need. Example: You can set there the players pos in the last death IF he/she died. (x=blue, y=green, z=red) https://wiki.multitheftauto.com/wiki/SpawnPlayer Link to comment
~SOV~DHooser15 Posted January 12, 2010 Author Share Posted January 12, 2010 Hm still isnt very clear...i tryed it again and now when i go in game i die and it just continually fades out nonstop Link to comment
~SOV~DHooser15 Posted January 12, 2010 Author Share Posted January 12, 2010 Hm still isnt very clear...i tryed it again and now when i go in game i die and it just continually fades out nonstop Link to comment
robhol Posted January 12, 2010 Share Posted January 12, 2010 function playerDied( ammo, attacker, weapon, bodypart ) gDiedX, gDiedY, gDiedZ= getElementPosition(source) -- We save wheres he/she dies end addEventHandler("onPlayerWasted", getRootElement(), playerDied) You need to research more at the wiki. You can edit the arguments in spawnPlayer( player, -711+math.random(1,5), 957+math.random(5,9), 12.4, 90, math.random(9,288) ) and set the arguments what you need. Example: You can set there the players pos in the last death IF he/she died. (x=blue, y=green, z=red) https://wiki.multitheftauto.com/wiki/SpawnPlayer Big mistake. If you have this code and two players die within a short while, they will both spawn at one location. Use a table, for example table[player][x,y,z] Link to comment
robhol Posted January 12, 2010 Share Posted January 12, 2010 function playerDied( ammo, attacker, weapon, bodypart ) gDiedX, gDiedY, gDiedZ= getElementPosition(source) -- We save wheres he/she dies end addEventHandler("onPlayerWasted", getRootElement(), playerDied) You need to research more at the wiki. You can edit the arguments in spawnPlayer( player, -711+math.random(1,5), 957+math.random(5,9), 12.4, 90, math.random(9,288) ) and set the arguments what you need. Example: You can set there the players pos in the last death IF he/she died. (x=blue, y=green, z=red) https://wiki.multitheftauto.com/wiki/SpawnPlayer Big mistake. If you have this code and two players die within a short while, they will both spawn at one location. Use a table, for example table[player][x,y,z] 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