Jump to content

Respawning Fail custom game mode


Recommended Posts

Hello I am having problems with my custom game mode I built.

When I die I don't respawn, But the other day I respawned just fine.

My lua code.

  
function joinHandler() 
    local x = 2026.935668953 
    local y = 1008.9664306641 
    local z = 14.663164138794 
    spawnPlayer(source, x, y, z) 
    fadeCamera(source, true) 
    setCameraTarget(source, source) 
    outputChatBox("Welcome to My Server", source) 
end 
addEventHandler("onPlayerJoin", getRootElement(), joinHandler) 
  
function playerDied(totalAmmo, killer, killerWeapon, bodypart) 
    outputChatBox(getPlayerName(source).." died!") 
end 
addEventHandler("onPlayerWasted",getRootElement(),playerDied) 
  

My meta.xml

  
<meta> 
     <info author="Neko^-^" type="gamemode" name="DragonDM" description="DagonDM Mode" /> 
     <include resource="helpmanager" /> 
     <script src="script.lua" Type="Client" /> 
     <map src="Dragon.map" /> 
     <config src="help.xml" type="client"/> 
</meta> 
  

My help.xml

  
<help> 
Welcome to the DragonDM 
Type /createvehicle car name/id to spawn vehicles. 
Made by Neko^-^ 
</help> 
  
  

I hope that's enough info I havn't made any changes at all since yesterday.

Link to comment

Well, you are obiously lying, because it could never respawn because there's no code for that.

local x = 2026.935668953 
local y = 1008.9664306641 
local z = 14.663164138794 
  
function joinHandler() 
    spawnPlayer(source, x, y, z) 
    fadeCamera(source, true) 
    setCameraTarget(source, source) 
    outputChatBox("Welcome to My Server", source) 
end 
addEventHandler("onPlayerJoin", getRootElement(), joinHandler) 
  
function playerDied(totalAmmo, killer, killerWeapon, bodypart) 
    outputChatBox(getPlayerName(source).." died!") 
    setTimer(spawnPlayer,1000,1,source, x, y, z) 
    setTimer(fadeCamera,1000,1,source, true) 
    setTimer(setCameraTarget,1000,1,source, source) 
end 
addEventHandler("onPlayerWasted",getRootElement(),playerDied) 

Btw, the meta.xml is also wrong.

<meta> 
     <info author="Neko^-^" type="gamemode" name="DragonDM" description="DagonDM Mode" /> 
     <include resource="helpmanager" /> 
     <script src="script.lua" Type="server" /> 
     <map src="Dragon.map" /> 
     <config src="help.xml" type="client"/> 
</meta> 

It should work.

Link to comment
Well, you are obiously lying, because it could never respawn because there's no code for that.
local x = 2026.935668953 
local y = 1008.9664306641 
local z = 14.663164138794 
  
function joinHandler() 
    spawnPlayer(source, x, y, z) 
    fadeCamera(source, true) 
    setCameraTarget(source, source) 
    outputChatBox("Welcome to My Server", source) 
end 
addEventHandler("onPlayerJoin", getRootElement(), joinHandler) 
  
function playerDied(totalAmmo, killer, killerWeapon, bodypart) 
    outputChatBox(getPlayerName(source).." died!") 
    setTimer(spawnPlayer,1000,1,source, x, y, z) 
    setTimer(fadeCamera,1000,1,source, true) 
    setTimer(setCameraTarget,1000,1,source, source) 
end 
addEventHandler("onPlayerWasted",getRootElement(),playerDied) 

Btw, the meta.xml is also wrong.

<meta> 
     <info author="Neko^-^" type="gamemode" name="DragonDM" description="DagonDM Mode" /> 
     <include resource="helpmanager" /> 
     <script src="script.lua" Type="server" /> 
     <map src="Dragon.map" /> 
     <config src="help.xml" type="client"/> 
</meta> 

It should work.

I wasn't lying but thanks, I probrably had something else running that might have to do with respawning.

Link to comment

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