ELmarcoS. Posted September 30, 2012 Share Posted September 30, 2012 Hola tengo un problema con este script, que spawnea al jugador cuando muere a una base que cree con unos amigos, estoy usando el spawn menu de 50p y tengo 2 opciones para elegir hasta ahora, civilian y umbrella corporation, el problema es que al elegir umbrella cuando el jugador muere lo spawnea a la base de los civilians, quiero saber como hago para que el script vea en que equipo está el jugador y si está en umbrella lo spawnee al morir a las coordenadas que yo ponga, acá les dejo lo que tengo: addEventHandler("onPlayerWasted", getRootElement(), function() spawnPlayer (source, 312.30529785156, -2040.5495605469, 2.4078125953674, 90, getElementModel ( source )) fadeCamera (source, true) setCameraTarget (source, source) end ) Gracias. Link to comment
Castillo Posted September 30, 2012 Share Posted September 30, 2012 getPlayerTeam getTeamName Link to comment
ELmarcoS. Posted September 30, 2012 Author Share Posted September 30, 2012 Esto estaría bien? addEventHandler("onPlayerWasted", getRootElement(), function(source) local civilian = getTeamFromName ( "Civilian" ) if ( civilian ) then spawnPlayer (source, 312.30529785156, -2040.5495605469, 2.4078125953674, 90, getElementModel ( source )) local umbrella = getTeamFromName ( "Umbrella Corporation" ) if ( umbrella ) then spawnPlayer (source, 245.29811096191, 1859.5770263672, 14.084012985229, 180, getElementModel ( source )) fadeCamera (source, true) setCameraTarget (source, source) end ) Link to comment
Renkon Posted September 30, 2012 Share Posted September 30, 2012 if (getTeamName(getPlayerTeam()) == "Umbrella") then Link to comment
ELmarcoS. Posted September 30, 2012 Author Share Posted September 30, 2012 addEventHandler("onPlayerWasted", getRootElement(), function(source) if (getTeamName(getPlayerTeam()) == "Civilian") then spawnPlayer (source, 312.30529785156, -2040.5495605469, 2.4078125953674, 90, getElementModel ( source )) fadeCamera (source, true) setCameraTarget (source, source) end ) addEventHandler ("onPlayerWasted", getRootElement(), function spawnOnDie(source) if (getTeamName(getPlayerTeam()) == "Umbrella Corporation") then spawnPlayer (source, 245.29811096191, 1859.5770263672, 14.084012985229, 180, getElementModel ( source )) fadeCamera (source, true) setCameraTarget (source, source) end ) hize esto pero creo que está mal porque al morir la pantalla queda en negro D: Link to comment
Castillo Posted September 30, 2012 Share Posted September 30, 2012 addEventHandler ( "onPlayerWasted", getRootElement(), function ( ) if ( getPlayerTeam ( source ) ) then if ( getTeamName ( getPlayerTeam ( source ) ) == "Civilian" ) then spawnPlayer ( source, 312.30529785156, -2040.5495605469, 2.4078125953674, 90, getElementModel ( source ) ) elseif ( getTeamName ( getPlayerTeam ( source ) ) == "Umbrella Corporation" ) then spawnPlayer ( source, 245.29811096191, 1859.5770263672, 14.084012985229, 180, getElementModel ( source ) ) end fadeCamera ( source, true ) setCameraTarget ( source, source ) end end ) Link to comment
ELmarcoS. Posted September 30, 2012 Author Share Posted September 30, 2012 Funciona pero cambia el skin, por que? Link to comment
Recommended Posts