Jump to content

Problem with Event "onPlayerWasted"


Recommended Posts

Posted

Hello,

Why its dont work? when i made it on command it works without any problems :x

function gowno() 
local r,g,b = getTeamColor(getPlayerTeam(source)) 
local hex = RGBToHex(r,g,b) 
                outputChatBox('dead'..hex..""..getPlayerName(source), getRootElement(), 255,255,255,true) 
end 
addEventHandler( "onPlayerWasted", getRootElement( ), gowno) 
  
  
function RGBToHex(red, green, blue, alpha) 
    if((red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255) or (alpha and (alpha < 0 or alpha > 255))) then 
        return nil 
    end 
    if(alpha) then 
        return string.format("#%.2X%.2X%.2X%.2X", red,green,blue,alpha) 
    else 
        return string.format("#%.2X%.2X%.2X", red,green,blue) 
    end 
end 

Posted

use lua highlight syntax please

Edit try this

function gowno(_,attacker) 
    if attacker and isElement(attacker) and getElementType(attacker) == "player" and attcker ~= source then  
        local r,g,b = getTeamColor(getPlayerTeam(source)) 
        local hex = RGBToHex(r,g,b) 
        outputChatBox('dead'..hex..""..getPlayerName(source), getRootElement(), 255,255,255,true) 
    end 
end  
addEventHandler( "onPlayerWasted", getRootElement( ), gowno) 

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted

try it with onClientPlayerWasted

-- Client Side

function gowmo() 
       local team = getPlayerTeam(source) 
       local r,g, b = getTeamColor(team) 
       local hex = RGBToHex (r, g, b) 
       ouputChatBox('dead'..hex..""..getPlayerName(source), getRootElement(), 255, 255, 255, true) 
end 
addEventHandler("onClientPlayerWasted",getLocalPlayer(), gowmo) 

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted
try it with onClientPlayerWasted

-- Client Side

function gowmo() 
       local team = getPlayerTeam(source) 
       local r,g, b = getTeamColor(team) 
       local hex = RGBToHex (r, g, b) 
       ouputChatBox('dead'..hex..""..getPlayerName(source), getRootElement(), 255, 255, 255, true) 
end 
addEventHandler("onClientPlayerWasted",getLocalPlayer(), gowmo) 

Debugscript:

Attempt to call global  'outputChatBox' (a nil value) 

Posted
try it with onClientPlayerWasted

-- Client Side

function gowmo() 
       local team = getPlayerTeam(source) 
       local r,g, b = getTeamColor(team) 
       local hex = RGBToHex (r, g, b) 
       ouputChatBox('dead'..hex..""..getPlayerName(source), getRootElement(), 255, 255, 255, true) 
end 
addEventHandler("onClientPlayerWasted",getLocalPlayer(), gowmo) 

Debugscript:

Attempt to call global  'outputChatBox' (a nil value) 

function gowmo() 
       local team = getPlayerTeam(source) 
       local r,g, b = getTeamColor(team) 
       local hex = RGBToHex (r, g, b) 
       ouputChatBox("dead"..hex..""..getPlayerName(source), 255, 255, 255, true) 
end 
addEventHandler("onClientPlayerWasted",getLocalPlayer(), gowmo) 

Posted
function gowmo() 
       local team = getPlayerTeam(source) 
       local r,g, b = getTeamColor(team) 
       local hex = RGBToHex (r, g, b) 
       ouputChatBox("dead"..hex..""..getPlayerName(source), 255, 255, 255, true) 
end 
addEventHandler("onClientPlayerWasted",getLocalPlayer(), gowmo) 

lol it's outputChatBox not ouputChatBox

function gowmo() 
       local team = getPlayerTeam(source) 
       local r,g, b = getTeamColor(team) 
       local hex = RGBToHex (r, g, b) 
       outputChatBox("dead"..hex..""..getPlayerName(source), 255, 255, 255, true) 
end 
addEventHandler("onClientPlayerWasted",getLocalPlayer(), gowmo) 

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted
function gowmo() 
       local team = getPlayerTeam(source) 
       local r,g, b = getTeamColor(team) 
       local hex = RGBToHex (r, g, b) 
       ouputChatBox("dead"..hex..""..getPlayerName(source), 255, 255, 255, true) 
end 
addEventHandler("onClientPlayerWasted",getLocalPlayer(), gowmo) 

lol it's outputChatBox not ouputChatBox

function gowmo() 
       local team = getPlayerTeam(source) 
       local r,g, b = getTeamColor(team) 
       local hex = RGBToHex (r, g, b) 
       outputChatBox("dead"..hex..""..getPlayerName(source), 255, 255, 255, true) 
end 
addEventHandler("onClientPlayerWasted",getLocalPlayer(), gowmo) 

Lol, didn't see that :D

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