Jump to content

spawns in game


Recommended Posts

Posted

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 :D

Posted

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 :D

Posted

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.

Posted

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.

Posted

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.

Posted

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.

Posted
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

Posted
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

Posted
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]

Posted
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]

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...