micheal1230 Posted June 27, 2012 Share Posted June 27, 2012 Well im getting a bad arg at everything with player next to it function balladeath(player) local getteam = getPlayerTeam ( player ) local getskin = getElementModel( player ) if getPlayerTeam(localPlayer) and getTeamName(getPlayerTeam(localPlayer)) == "Ballas" then spawnPlayer(player, 1922.4970703125, -1127.9501953125, 25.042316436768, 0, getskin, 0, 0, getteam) else cancelEvent() end end addEventHandler("onPlayerWasted", getRootElement(), balladeath) function policedeath(player) local getteam = getPlayerTeam ( player ) local getskin = getElementModel( player ) if getPlayerTeam(localPlayer) and getTeamName(getPlayerTeam(localPlayer)) == "Police" then spawnPlayer(player, 1545.6162109375, -1675.33203125, 13.560710906982, 95, getskin, 0, 0, getteam) else cancelEvent() end end addEventHandler("onPlayerWasted", getRootElement(), policedeath) function grovedeath(player) local getteam = getPlayerTeam ( player ) local getskin = getElementModel( player ) if getPlayerTeam(localPlayer) and getTeamName(getPlayerTeam(localPlayer)) == "Grove" then spawnPlayer(player, 2495.24609375, -1687.2548828125, 13.515160560608, 0, getskin, 0, 0, getteam) else cancelEvent() end end addEventHandler("onPlayerWasted", getRootElement(), grovedeath) Link to comment
Castillo Posted June 27, 2012 Share Posted June 27, 2012 The player that died is 'source'. Link to comment
micheal1230 Posted June 27, 2012 Author Share Posted June 27, 2012 The player that died is 'source'. I dont respawn, it just stays in death cam Link to comment
Castillo Posted June 27, 2012 Share Posted June 27, 2012 cancelEvent() That's not needed, you can't cancel death. Link to comment
Anderl Posted June 27, 2012 Share Posted June 27, 2012 addEventHandler( 'onPlayerWasted', root, function( ) if( getPlayerTeam( source ) ) then if( getTeamName( getPlayerTeam( source ) ) == 'Ballas' ) then spawnPlayer( source, 1922.4970703125, -1127.9501953125, 25.042316436768, 0, getElementModel( source ) or 0, 0, 0, getPlayerTeam( source ) ); elseif( getTeamName( getPlayerTeam( source ) ) == 'Police' ) then spawnPlayer( source, 1545.6162109375, -1675.33203125, 13.560710906982, 95, getElementModel( source ) or 0, 0, 0, getPlayerTeam( source ) ); elseif( getTeamName( getPlayerTeam( source ) ) == 'Grove' ) then spawnPlayer( source, 2495.24609375, -1687.2548828125, 13.515160560608, 0, getElementModel( source ) or 0, 0, 0, getPlayerTeam( source ) ); else -- spawn player somewhere else end else -- spawn player somewhere else end end ) Link to comment
micheal1230 Posted June 28, 2012 Author Share Posted June 28, 2012 cancelEvent() That's not needed, you can't cancel death. woops left that in i was going to have it all in 1 function but i didnt Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now