Jump to content

Ayuda mensajes de muertes en el chat


lGalazArayal

Recommended Posts

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
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
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
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
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
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
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
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
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
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
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
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
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
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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...