Alexs Posted January 12, 2015 Share Posted January 12, 2015 Pero por que ami me funciono ?puedes estar en lo sierto alexs por que lo probe solo no con otro Player. El segundo mensaje funcionaria correctamente, pero todo lo referente a la existencia de 'morir' no daría resultado alguno. Link to comment
MisterZ Posted January 12, 2015 Share Posted January 12, 2015 Vale entiendo, pero como se solucionaria esto ? Link to comment
Alexs Posted January 12, 2015 Share Posted January 12, 2015 Vale entiendo, pero como se solucionaria esto ? Utilizando una variable definida, en este caso debería ser 'killer'. Link to comment
MisterZ Posted January 12, 2015 Share Posted January 12, 2015 Vale entiendo, pero como se solucionaria esto ? Utilizando una variable definida, en este caso debería ser 'killer'. y como se define una variable (disculpa mi ignorancia) Link to comment
lGalazArayal Posted January 12, 2015 Author Share Posted January 12, 2015 function player_Wasted (ammo, killer, weapon) if not killer or killer == source then outputChatBox(getPlayerName(source).." Se Ha Suicidado!") else outputChatBox(getPlayerName(killer).." Le partio el culo a "..getPlayerName(source).." con una ("..getWeaponNameFromID(weapon)..")") end end addEventHandler("onPlayerWasted", getRootElement(), player_Wasted) Si funciona pero quiero que los nombre salgan a color espero que me ayudes gracias Link to comment
Alexs Posted January 12, 2015 Share Posted January 12, 2015 y como se define una variable (disculpa mi ignorancia) En el caso de tu código, se definen en base a los parámetros de la función. function player_Wasted (ammo, killer, weapon) if not killer or killer == source then outputChatBox(getPlayerName(source).." Se Ha Suicidado!") else outputChatBox(getPlayerName(killer).." Le partio el culo a "..getPlayerName(source).." con una ("..getWeaponNameFromID(weapon)..")") end end addEventHandler("onPlayerWasted", getRootElement(), player_Wasted) Si funciona pero quiero que los nombre salgan a color espero que me ayudes gracias ¿Algo así? function player_Wasted (ammo, killer, weapon) if not killer or killer == source then outputChatBox(getPlayerName(source).." #00BF0DSe Ha Suicidado!", root, 0, 191, 13, true ) else outputChatBox(getPlayerName(killer).." #00BF0DLe partio el culo a "..getPlayerName(source).." #00BF0Dcon una ("..getWeaponNameFromID(weapon).."#00BF0D)", root, 0, 191, 13, true) end end addEventHandler("onPlayerWasted", getRootElement(), player_Wasted) Link to comment
Castillo Posted January 12, 2015 Share Posted January 12, 2015 function player_Wasted ( ammo, attacker, weapon, bodypart ) -- if there was an attacker if ( attacker ) then -- we declare our variable outside the following checks local tempString -- if the element that killed him was a player, local r,g,b = getPlayerNametagColor ( source ) --get the player's nametag colour if ( getElementType ( attacker ) == "player" ) then -- put the attacker, victim and weapon info in the string tempString = getPlayerName ( attacker ).." Le partio el culo a "..getPlayerName ( source ).." con una ("..getWeaponNameFromID ( weapon )..")" -- else, if it was a vehicle, elseif ( getElementType ( attacker ) == "vehicle" ) then -- we'll get the name from the attacker vehicle's driver tempString = getPlayerName ( getVehicleController ( attacker ) ).." mato a "..getPlayerName ( source ).." ("..getWeaponNameFromID ( weapon )..")" end -- if the victim was shot in the head, append a special message if ( bodypart == 9 ) then tempString = tempString.." (HEADSHOT!)" -- else, just append the bodypart name else tempString = tempString.." ("..getBodyPartName ( bodypart )..")" end if ( attacker == source ) then tempString == getPlayerName ( source ) .." se ha suicidado" end -- display the message outputChatBox ( tempString, root, 255, 255, 255, true ) -- Aca -- if there was no attacker, elseif ( not attacker or attacker == source ) then -- output a death message without attacker info outputChatBox ( getPlayerName ( source ) .." se ha suicidado", root, 255, 255, 255, true ) -- Y aca end end addEventHandler ( "onPlayerWasted", getRootElement(), player_Wasted ) Link to comment
lGalazArayal Posted January 12, 2015 Author Share Posted January 12, 2015 function player_Wasted ( ammo, attacker, weapon, bodypart ) -- if there was an attacker if ( attacker ) then -- we declare our variable outside the following checks local tempString -- if the element that killed him was a player, local r,g,b = getPlayerNametagColor ( source ) --get the player's nametag colour if ( getElementType ( attacker ) == "player" ) then -- put the attacker, victim and weapon info in the string tempString = getPlayerName ( attacker ).." Le partio el culo a "..getPlayerName ( source ).." con una ("..getWeaponNameFromID ( weapon )..")" -- else, if it was a vehicle, elseif ( getElementType ( attacker ) == "vehicle" ) then -- we'll get the name from the attacker vehicle's driver tempString = getPlayerName ( getVehicleController ( attacker ) ).." mato a "..getPlayerName ( source ).." ("..getWeaponNameFromID ( weapon )..")" end -- if the victim was shot in the head, append a special message if ( bodypart == 9 ) then tempString = tempString.." (HEADSHOT!)" -- else, just append the bodypart name else tempString = tempString.." ("..getBodyPartName ( bodypart )..")" end -- display the message outputChatBox ( tempString, root, 255, 255, 255, true ) -- Aca -- if there was no attacker, elseif ( not attacker or attacker == source ) then -- output a death message without attacker info outputChatBox ( getPlayerName ( source ).." se ha suicidado", root, 255, 255, 255, true ) -- Y aca end end addEventHandler ( "onPlayerWasted", getRootElement(), player_Wasted ) En este sale lo mismo cuando me mato con basuca sale Galaz le ha partido el culo a Galaz y cuando me suicido del freerom sale se ha suicidado eso esta bien pero cuando me mato yo mismo Galaz le ha partido el culo a Galaz con rocket ¿Que más se puede hacer? Link to comment
lGalazArayal Posted January 12, 2015 Author Share Posted January 12, 2015 y como se define una variable (disculpa mi ignorancia) En el caso de tu código, se definen en base a los parámetros de la función. function player_Wasted (ammo, killer, weapon) if not killer or killer == source then outputChatBox(getPlayerName(source).." Se Ha Suicidado!") else outputChatBox(getPlayerName(killer).." Le partio el culo a "..getPlayerName(source).." con una ("..getWeaponNameFromID(weapon)..")") end end addEventHandler("onPlayerWasted", getRootElement(), player_Wasted) Si funciona pero quiero que los nombre salgan a color espero que me ayudes gracias ¿Algo así? function player_Wasted (ammo, killer, weapon) if not killer or killer == source then outputChatBox(getPlayerName(source).." #00BF0DSe Ha Suicidado!", root, 0, 191, 13, true ) else outputChatBox(getPlayerName(killer).." #00BF0DLe partio el culo a "..getPlayerName(source).." #00BF0Dcon una ("..getWeaponNameFromID(weapon).."#00BF0D)", root, 0, 191, 13, true) end end addEventHandler("onPlayerWasted", getRootElement(), player_Wasted) No, los nombres a color espero que me ayudes gracias. Link to comment
Castillo Posted January 12, 2015 Share Posted January 12, 2015 function player_Wasted ( ammo, attacker, weapon, bodypart ) -- if there was an attacker if ( attacker ) then -- we declare our variable outside the following checks local tempString -- if the element that killed him was a player, local r,g,b = getPlayerNametagColor ( source ) --get the player's nametag colour if ( getElementType ( attacker ) == "player" ) then -- put the attacker, victim and weapon info in the string tempString = getPlayerName ( attacker ).." Le partio el culo a "..getPlayerName ( source ).." con una ("..getWeaponNameFromID ( weapon )..")" -- else, if it was a vehicle, elseif ( getElementType ( attacker ) == "vehicle" ) then -- we'll get the name from the attacker vehicle's driver tempString = getPlayerName ( getVehicleController ( attacker ) ).." mato a "..getPlayerName ( source ).." ("..getWeaponNameFromID ( weapon )..")" end -- if the victim was shot in the head, append a special message if ( bodypart == 9 ) then tempString = tempString.." (HEADSHOT!)" -- else, just append the bodypart name else tempString = tempString.." ("..getBodyPartName ( bodypart )..")" end -- display the message outputChatBox ( tempString, root, 255, 255, 255, true ) -- Aca -- if there was no attacker, elseif ( not attacker or attacker == source ) then -- output a death message without attacker info outputChatBox ( getPlayerName ( source ).." se ha suicidado", root, 255, 255, 255, true ) -- Y aca end end addEventHandler ( "onPlayerWasted", getRootElement(), player_Wasted ) En este sale lo mismo cuando me mato con basuca sale Galaz le ha partido el culo a Galaz y cuando me suicido del freerom sale se ha suicidado eso esta bien pero cuando me mato yo mismo Galaz le ha partido el culo a Galaz con rocket ¿Que más se puede hacer? Ah cierto, ya se porque es, copia el codigo de nuevo y probalo. Link to comment
MisterZ Posted January 12, 2015 Share Posted January 12, 2015 addEventHandler("onPlayerWasted", getRootElement(), function (ammo, killer, weapon) if (not killer and killer == source) then outputChatBox(getPlayerName(killer).." #00BF0DLe partio el culo a "..getPlayerName(source).." #00BF0Dcon una ("..getWeaponNameFromID(weapon).."#00BF0D)", root, 0, 191, 13, true) else outputChatBox(getPlayerName(source).." #00BF0DSe Ha Suicidado!", root, 0, 191, 13, true ) end end ) Link to comment
lGalazArayal Posted January 12, 2015 Author Share Posted January 12, 2015 function player_Wasted ( ammo, attacker, weapon, bodypart ) -- if there was an attacker if ( attacker ) then -- we declare our variable outside the following checks local tempString -- if the element that killed him was a player, local r,g,b = getPlayerNametagColor ( source ) --get the player's nametag colour if ( getElementType ( attacker ) == "player" ) then -- put the attacker, victim and weapon info in the string tempString = getPlayerName ( attacker ).." Le partio el culo a "..getPlayerName ( source ).." con una ("..getWeaponNameFromID ( weapon )..")" -- else, if it was a vehicle, elseif ( getElementType ( attacker ) == "vehicle" ) then -- we'll get the name from the attacker vehicle's driver tempString = getPlayerName ( getVehicleController ( attacker ) ).." mato a "..getPlayerName ( source ).." ("..getWeaponNameFromID ( weapon )..")" end -- if the victim was shot in the head, append a special message if ( bodypart == 9 ) then tempString = tempString.." (HEADSHOT!)" -- else, just append the bodypart name else tempString = tempString.." ("..getBodyPartName ( bodypart )..")" end -- display the message outputChatBox ( tempString, root, 255, 255, 255, true ) -- Aca -- if there was no attacker, elseif ( not attacker or attacker == source ) then -- output a death message without attacker info outputChatBox ( getPlayerName ( source ).." se ha suicidado", root, 255, 255, 255, true ) -- Y aca end end addEventHandler ( "onPlayerWasted", getRootElement(), player_Wasted ) En este sale lo mismo cuando me mato con basuca sale Galaz le ha partido el culo a Galaz y cuando me suicido del freerom sale se ha suicidado eso esta bien pero cuando me mato yo mismo Galaz le ha partido el culo a Galaz con rocket ¿Que más se puede hacer? Ah cierto, ya se porque es, copia el codigo de nuevo y probalo. No no funciona sale Galaz le ha partido el culo a Galaz ¿Que mas se puede hacer? Link to comment
lGalazArayal Posted January 12, 2015 Author Share Posted January 12, 2015 addEventHandler("onPlayerWasted", getRootElement(), function (ammo, killer, weapon) if (not killer and killer == source) then outputChatBox(getPlayerName(killer).." #00BF0DLe partio el culo a "..getPlayerName(source).." #00BF0Dcon una ("..getWeaponNameFromID(weapon).."#00BF0D)", root, 0, 191, 13, true) else outputChatBox(getPlayerName(source).." #00BF0DSe Ha Suicidado!", root, 0, 191, 13, true ) end end ) Este sale cuando mato a alguien que cuando mato a alguien sale como qque se suicido ¿Que mas se puede hacer? Link to comment
MisterZ Posted January 12, 2015 Share Posted January 12, 2015 EDIT: Ya no se me ocurre nada ami. Link to comment
Castillo Posted January 12, 2015 Share Posted January 12, 2015 Seguro que copiaste el codigo de mi post original? porque deberia funcionar, postea lo que copiaste aca. Link to comment
lGalazArayal Posted January 12, 2015 Author Share Posted January 12, 2015 Seguro que copiaste el codigo de mi post original? porque deberia funcionar, postea lo que copiaste aca. function player_Wasted (ammo, killer, weapon) if not killer or killer == source then outputChatBox(getPlayerName(source).." Se Ha Suicidado!") else outputChatBox(getPlayerName(killer).." Le partio el culo a "..getPlayerName(source).." con una ("..getWeaponNameFromID(weapon)..")") end end addEventHandler("onPlayerWasted", getRootElement(), player_Wasted) Este funciona bien como yo quiero pero hay un problema que los nombres de los jugadores que no salen a color ¿Que más se puede hacer? Link to comment
MisterZ Posted January 12, 2015 Share Posted January 12, 2015 Seguro que copiaste el codigo de mi post original? porque deberia funcionar, postea lo que copiaste aca. function player_Wasted (ammo, killer, weapon) if not killer or killer == source then outputChatBox(getPlayerName(source).." Se Ha Suicidado!") else outputChatBox(getPlayerName(killer).." Le partio el culo a "..getPlayerName(source).." con una ("..getWeaponNameFromID(weapon)..")") end end addEventHandler("onPlayerWasted", getRootElement(), player_Wasted) Este funciona bien como yo quiero pero hay un problema que los nombres de los jugadores que no salen a color ¿Que más se puede hacer? Este sale en color Verde cambile los valores donde termina el chatBox y hay acamodas los colores function player_Wasted (ammo, killer, weapon) if not killer or killer == source then outputChatBox(getPlayerName(source).." Se Ha Suicidado!",source,0,255,0,true) else outputChatBox(getPlayerName(killer).." Le partio el culo a "..getPlayerName(source).." con una ("..getWeaponNameFromID(weapon)..")",source,0,255,0,true) end end addEventHandler("onPlayerWasted", getRootElement(), player_Wasted) Link to comment
lGalazArayal Posted January 12, 2015 Author Share Posted January 12, 2015 Seguro que copiaste el codigo de mi post original? porque deberia funcionar, postea lo que copiaste aca. function player_Wasted (ammo, killer, weapon) if not killer or killer == source then outputChatBox(getPlayerName(source).." Se Ha Suicidado!") else outputChatBox(getPlayerName(killer).." Le partio el culo a "..getPlayerName(source).." con una ("..getWeaponNameFromID(weapon)..")") end end addEventHandler("onPlayerWasted", getRootElement(), player_Wasted) Este funciona bien como yo quiero pero hay un problema que los nombres de los jugadores que no salen a color ¿Que más se puede hacer? Este sale en color Verde cambile los valores donde termina el chatBox y hay acamodas los colores function player_Wasted (ammo, killer, weapon) if not killer or killer == source then outputChatBox(getPlayerName(source).." Se Ha Suicidado!",source,0,255,0,true) else outputChatBox(getPlayerName(killer).." Le partio el culo a "..getPlayerName(source).." con una ("..getWeaponNameFromID(weapon)..")",source,0,255,0,true) end end addEventHandler("onPlayerWasted", getRootElement(), player_Wasted) lo del suicidio sale bien pero ahora nisiquiera aparece el mensaje Galaz le ha partido del culo a diego Link to comment
MisterZ Posted January 12, 2015 Share Posted January 12, 2015 Man ese es el Script que posteaste tu que te (SERVIA) solo le agregue los colores. Link to comment
Sasu Posted January 12, 2015 Share Posted January 12, 2015 function player_Wasted (ammo, killer, weapon) if not killer or killer == source then outputChatBox(getPlayerName(source).." Se Ha Suicidado!", root,0,255,0,true) else outputChatBox(getPlayerName(killer).." Le partio el culo a "..getPlayerName(source).." con una ("..getWeaponNameFromID(weapon)..")", root,0,255,0,true) end end addEventHandler("onPlayerWasted", getRootElement(), player_Wasted) Link to comment
lGalazArayal Posted January 13, 2015 Author Share Posted January 13, 2015 function player_Wasted (ammo, killer, weapon) if not killer or killer == source then outputChatBox(getPlayerName(source).." Se Ha Suicidado!", root,0,255,0,true) else outputChatBox(getPlayerName(killer).." Le partio el culo a "..getPlayerName(source).." con una ("..getWeaponNameFromID(weapon)..")", root,0,255,0,true) end end addEventHandler("onPlayerWasted", getRootElement(), player_Wasted) Muchas gracias me sirvio mucho muchas gracias Link to comment
Recommended Posts