Jump to content

Spawn Problem


ertlflorian1

Recommended Posts

Hello a player wont respan after death can somebody help me? (its from Godmother)

function onWasted ( totalAmmo, killer, killerWeapon, bodypart, stealth ) 
    fadeCamera (source, false) 
     
    local wanteds = getPlayerWantedLevel(source) 
    if killer then local killerskin = getElementModel(killer) end 
    local userskin = getElementModel(source) 
     
    if (wanteds ~= 0) and (policeKiller[killerskin]) then 
        setPlayerWantedLevel(source,0) 
        setElementData(source, "Wanted",0) 
        local jailtime = wanteds*8 
        setElementData(source, "Jailtime", jailtime) 
        outputChatBox("Du wurdest für "..tonumber(jailtime).." Minuten ins Gefangniss gesteckt!", source, 255,0,0) 
        outputChatBox("Du hast "..getPlayerName(source).." eingeknastet!", killer, 255,0,0) 
    end 
     
    local Spawn = getElementData( source, "Spawn" ) 
    if getElementData(source, "Jailtime") ~= 0 then 
        spawnPlayer (source, 193.7802734375, 174.71875, 1003.0234375, 0, userskin, 0, 0, spawnTeam) 
        setElementInterior(source,3, 193.7802734375, 174.71875, 1003.0234375)        
    elseif Spawn == 0 then 
        spawnPlayer (source, 2193.9836425781, 1986.7907714844, 12.296875, 0, userskin, 0, 0, spawnTeam) 
    elseif Spawn == 1 then 
        if getElementData(source, "Fraktion") ~= 0 then 
            if playerFraktion == 1 then 
                spawnPlayer (source, 2289.52734375, 2423.654296875, 10.8203125, 0, userskin, 0, 0, spawnTeam) 
            elseif playerFraktion == 2 then 
                spawnPlayer (source, 1064.5804443359, 2139.6967773438, 10.8203125, 0, userskin, 0, 0, spawnTeam) 
            elseif playerFraktion == 3 then 
                spawnPlayer (source, 1039.01171875, 1013.5325317383, 11, 0, userskin, 0, 0, spawnTeam) 
            elseif playerFraktion == 4 then 
                spawnPlayer (source, 153.97680664063, 1849.1361083984, 16.54062461853, 0, userskin, 0, 0, spawnTeam) 
            elseif playerFraktion == 5 then 
                spawnPlayer (source, 2899.501953125, 2198.1945800781, 10.8203125, 0, userskin, 0, 0, spawnTeam) 
            elseif playerFraktion == 6 then 
                spawnPlayer (source, 1709.5311279297, 688.06420898438, 10.8203125, 0, userskin, 0, 0, spawnTeam) 
            elseif playerFraktion == 7 then 
                spawnPlayer (source, -774.70977783203, 2418.2504882813, 157.10034179688, 0, userskin, 0, 0, spawnTeam) 
            elseif playerFraktion == 8 then 
                spawnPlayer (source, -2346.5776367188, -1633.1787109375, 484.70721435547, 0, userskin, 0, 0, spawnTeam) 
            elseif playerFraktion == 9 then 
                spawnPlayer (source, 2797.9909667969, 991.68756103516, 10.75, 0, userskin, 0, 0, spawnTeam) 
            elseif playerFraktion == 10 then 
                spawnPlayer (source, 8, 1374.4063720703, 10.2734375, 0, userskin, 0, 0, spawnTeam) 
            elseif playerFraktion == 11 then 
                spawnPlayer (source, -308.05072021484, 1538.96484375, 75.5625, 0, userskin, 0, 0, spawnTeam) 
            elseif playerFraktion == 12 then 
                spawnPlayer (source, 1584.8629150391, 1797.7447509766, 10.828001022339, 0, userskin, 0, 0, spawnTeam) 
            elseif playerFraktion == 13 then 
                spawnPlayer (source, 1439.0770263672, -2952.7312011719, 4.828001022339, 0, userskin, 0, 0, spawnTeam) 
            end 
        else 
            setElementData( source, "Spawn", 0 ) 
            spawnPlayer (source, 2193.9836425781, 1986.7907714844, 12.296875, 0, userskin, 0, 0, spawnTeam) 
            outputChatBox( "Du hast keine gültige Fraktion!", source ) 
        end 
    end 
     
    if playerFraktion == 0 then 
        setPlayerTeam(source, Zivilisten) 
    elseif playerFraktion == 1 then 
        setPlayerTeam(source, Cops)    
    elseif playerFraktion == 2 then 
        setPlayerTeam(source, Triaden) 
    elseif playerFraktion == 3 then 
        setPlayerTeam(source, Reporter) 
    elseif playerFraktion == 4 then 
        setPlayerTeam(source, Army) 
    elseif playerFraktion == 5 then 
        setPlayerTeam(source, FBI) 
    elseif playerFraktion == 6 then 
        setPlayerTeam(source, ADAC) 
    elseif playerFraktion == 7 then 
        setPlayerTeam(source, Aztecas) 
    elseif playerFraktion == 8 then 
        setPlayerTeam(source, Terror) 
    elseif playerFraktion == 9 then 
        setPlayerTeam(source, Mafia) 
    elseif playerFraktion == 10 then 
        setPlayerTeam(source, Angels) 
    elseif playerFraktion == 11 then 
        setPlayerTeam(source, Hitman) 
    elseif playerFraktion == 12 then 
        setPlayerTeam(source, Sanitaeter) 
    elseif playerFraktion == 13 then 
        setPlayerTeam(source, Undercover) 
    end 
    setTimer (setCameraTarget, 1250, 1, source, source) 
    setTimer (fadeCamera, 2000, 1, source, true) 
    setElementData (source,"onTruck", 0) 
end 
addEventHandler ( "onPlayerWasted", getRootElement(), onWasted ) 

Link to comment
  • Other Languages Moderators

playerFraktion and spawnTeam and Zivilisten and Cops and Triaden and Reporter and Army and FBI and ADAC and Aztecas and Terror and Mafia and Angels and Hitman and Sanitaeter and Undercover

is not defined anywhere in your code.

Link to comment
function onWasted ( totalAmmo, killer, killerWeapon, bodypart, stealth ) 
    fadeCamera (source, false) 
    local playerFraktion = getElementData(source,"Fraktion") 
    local wanteds = getPlayerWantedLevel(source) 
    local userskin = getElementModel(source) 
    local Spawn = getElementData( source, "Spawn" ) 
    if killer then local killerskin = getElementModel(killer) end 
    if (wanteds ~= 0) and (policeKiller[killerskin]) then 
        setPlayerWantedLevel(source,0) 
        setElementData(source, "Wanted",0) 
        local jailtime = wanteds*8 
        setElementData(source, "Jailtime", jailtime) 
        outputChatBox("Du wurdest für "..tonumber(jailtime).." Minuten ins Gefangniss gesteckt!", source, 255,0,0) 
        outputChatBox("Du hast "..getPlayerName(source).." eingeknastet!", killer, 255,0,0) 
    end 
    if getElementData(source, "Jailtime") ~= 0 then 
        spawnPlayer (source, 193.7802734375, 174.71875, 1003.0234375, 0, userskin, 0, 0, spawnTeam) 
        setElementInterior(source,3, 193.7802734375, 174.71875, 1003.0234375)        
    elseif Spawn == 0 then 
        spawnPlayer (source, 2193.9836425781, 1986.7907714844, 12.296875, 0, userskin, 0, 0, spawnTeam) 
    elseif Spawn == 1 then 
        if playerFraktion ~= 0 then 
            if playerFraktion == 1 then 
                spawnPlayer (source, 2289.52734375, 2423.654296875, 10.8203125, 0, userskin, 0, 0, spawnTeam) 
            elseif playerFraktion == 2 then 
                spawnPlayer (source, 1064.5804443359, 2139.6967773438, 10.8203125, 0, userskin, 0, 0, spawnTeam) 
            elseif playerFraktion == 3 then 
                spawnPlayer (source, 1039.01171875, 1013.5325317383, 11, 0, userskin, 0, 0, spawnTeam) 
            elseif playerFraktion == 4 then 
                spawnPlayer (source, 153.97680664063, 1849.1361083984, 16.54062461853, 0, userskin, 0, 0, spawnTeam) 
            elseif playerFraktion == 5 then 
                spawnPlayer (source, 2899.501953125, 2198.1945800781, 10.8203125, 0, userskin, 0, 0, spawnTeam) 
            elseif playerFraktion == 6 then 
                spawnPlayer (source, 1709.5311279297, 688.06420898438, 10.8203125, 0, userskin, 0, 0, spawnTeam) 
            elseif playerFraktion == 7 then 
                spawnPlayer (source, -774.70977783203, 2418.2504882813, 157.10034179688, 0, userskin, 0, 0, spawnTeam) 
            elseif playerFraktion == 8 then 
                spawnPlayer (source, -2346.5776367188, -1633.1787109375, 484.70721435547, 0, userskin, 0, 0, spawnTeam) 
            elseif playerFraktion == 9 then 
                spawnPlayer (source, 2797.9909667969, 991.68756103516, 10.75, 0, userskin, 0, 0, spawnTeam) 
            elseif playerFraktion == 10 then 
                spawnPlayer (source, 8, 1374.4063720703, 10.2734375, 0, userskin, 0, 0, spawnTeam) 
            elseif playerFraktion == 11 then 
                spawnPlayer (source, -308.05072021484, 1538.96484375, 75.5625, 0, userskin, 0, 0, spawnTeam) 
            elseif playerFraktion == 12 then 
                spawnPlayer (source, 1584.8629150391, 1797.7447509766, 10.828001022339, 0, userskin, 0, 0, spawnTeam) 
            elseif playerFraktion == 13 then 
                spawnPlayer (source, 1439.0770263672, -2952.7312011719, 4.828001022339, 0, userskin, 0, 0, spawnTeam) 
            end 
        else 
            setElementData( source, "Spawn", 0 ) 
            spawnPlayer (source, 2193.9836425781, 1986.7907714844, 12.296875, 0, userskin, 0, 0, spawnTeam) 
            outputChatBox( "Du hast keine gültige Fraktion!", source ) 
        end 
    end 
     
    if playerFraktion == 0 then 
        setPlayerTeam(source, Zivilisten) 
    elseif playerFraktion == 1 then 
        setPlayerTeam(source, Cops)    
    elseif playerFraktion == 2 then 
        setPlayerTeam(source, Triaden) 
    elseif playerFraktion == 3 then 
        setPlayerTeam(source, Reporter) 
    elseif playerFraktion == 4 then 
        setPlayerTeam(source, Army) 
    elseif playerFraktion == 5 then 
        setPlayerTeam(source, FBI) 
    elseif playerFraktion == 6 then 
        setPlayerTeam(source, ADAC) 
    elseif playerFraktion == 7 then 
        setPlayerTeam(source, Aztecas) 
    elseif playerFraktion == 8 then 
        setPlayerTeam(source, Terror) 
    elseif playerFraktion == 9 then 
        setPlayerTeam(source, Mafia) 
    elseif playerFraktion == 10 then 
        setPlayerTeam(source, Angels) 
    elseif playerFraktion == 11 then 
        setPlayerTeam(source, Hitman) 
    elseif playerFraktion == 12 then 
        setPlayerTeam(source, Sanitaeter) 
    elseif playerFraktion == 13 then 
        setPlayerTeam(source, Undercover) 
    end 
    setTimer (setCameraTarget, 1250, 1, source, source) 
    setTimer (fadeCamera, 2000, 1, source, true) 
    setElementData (source,"onTruck", 0) 
end 
addEventHandler ( "onPlayerWasted", getRootElement(), onWasted ) 

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