Jump to content

[HELP] Spawn Point ²


Recommended Posts

Posted

I want more than one spawn point and more than one point spawndie

    local joinX = 555.0 
    local joinY = 122.0 
    local joinZ = 123.0 
  
    local joinWeapon = 22 
    local joinAmmo = 200 
    local joinSkin = 0 
  
  
    local spawnX = 0.0 
    local spawnY = 0.0 
    local spawnZ = 0.0 
  
  
    local spawnWeapon = 22 
    local spawnAmmo = 200 
    local spawnSkin = 0 
  
    local killerMoney = 500 
    local deadPlayerMoney = 500 
    local joinMoney = 1000 
  
function spawnOnJoin() 
    spawnPlayer(source, joinX, joinY, joinZ, 0 , joinSkin) 
    fadeCamera(source, true) 
    setCameraTarget(source, source) 
    outputChatBox(joinMessage, source) 
    giveWeapon(source, joinWeapon, joinAmmo) 
    givePlayerMoney(source, joinMoney) 
end 
  
function spawnOnDead(ammo, killer, weapon, bodypart) 
    outputChatBox(getPlayerName(source).." died.") 
    takePlayerMoney(source, deadPlayerMoney) 
    if (killer) and (killer ~= source) then 
        givePlayerMoney(killer, killerMoney) 
    end 
    setTimer(spawnPlayer, 3000, 1, source, spawnX, spawnY, spawnZ, 0, spawnSkin) 
    setCameraTarget(source, source) 
    setTimer(giveWeapon, 3000, 1, source, spawnWeapon, spawnAmmo) 
end 
  
addEventHandler("onPlayerJoin", getRootElement(), spawnOnJoin) 
addEventHandler("onPlayerWasted", getRootElement(), spawnOnDead) 

Do not know what it want to use the player spawn in several coordinates could add more than 1 coodinates spawnpoint and more 1 spawndie?

Posted

Use a table, it'll make it easier.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
Use a table, it'll make it easier.

I think it so difficult for him

@ Lucario, it would make it much easier. (As long as you know how to use tables...)

yes im know use tables

560x95.png

430x73.png

  • Moderators
Posted

Maybe it is handy to give him link of a table tutorial.

http://lua-users.org/wiki/TablesTutorial

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

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...