Jump to content

onPlayerwasted question


Recommended Posts

Hey i will make when a people die (onPlayerWasted) that he start at this coordinates

Fraktion 0

2193.9836425781, 1986.7907714844, 12.296875

Fraktion 1

2289.52734375, 2423.654296875, 10.8203125

Fraktion 2

1064.5804443359, 2139.6967773438, 10.8203125

Fraktion 3

1039.01171875, 1013.5325317383, 11

Fraktion 4

153.97680664063, 1849.1361083984, 16.54062461853

Fraktion 5

2899.501953125, 2198.1945800781, 10.8203125

Fraktion 6

1709.5311279297, 688.06420898438, 10.8203125

Fraktion 7

-774.70977783203, 2418.2504882813, 157.10034179688

Fraktion 8

-2346.5776367188, -1633.1787109375, 484.70721435547

Fraktion 9

2797.9909667969, 991.68756103516, 10.75

Fraktion 10

8, 1374.4063720703, 10.2734375

Fraktion 11

-308.05072021484, 1538.96484375, 75.5625

Fraktion 12

1584.8629150391, 1797.7447509766, 10.828001022339

Fraktion 13

1439.0770263672, -2952.7312011719, 4.828001022339

This is from Godmother when a people die in Godmother he wouldn´t spawn or does somebody know how to fix this bug?

And when a people died that he start with the Skin of the mysql database?

Link to comment

Godmother?

You need to show a lot more info before we (Or at least myself) can help you.

I could show you an example already, but that would probably just confuse you.

Before I help, do you know anything about scripting at all? I am asking because I need to know how to explain things to you.

Link to comment

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 )

This is from the Script but it dont works!

Link to comment

May be my eyes but i can't see where playerFraktion is defined.

Put this under "local Spawn = getElementData( source, "Spawn" )"

  
local playerFraction = getElementData(source, "Fraktion") or 0 
  

also use Lua tags like:

[lua] code  

[/lua]

That was annoying to write sorry i couldn't find a better way.

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