Jump to content

Help


stefutz101

Recommended Posts

function player_Wasted ( attacker  ) 
     if attacker and getElementType(attacker) == "player" and attacker ~= source then 
        outputChatBox(getPlayerName(attacker).." killed "..getPlayerName (source),getRootElement(),255,255,255) 
    end 
end 
addEventHandler ( "onPlayerWasted", getRootElement(), player_Wasted ) 

Error "outputChatBox(getPlayerName(attacker).." killed "..getPlayerName (source),getRootElement(),255,255,255)" Boolean value :(

Link to comment
function player_Wasted(_, attacker) 
    if attacker then 
        if getElementType(attacker) == "player" then 
            outputChatBox(getPlayerName(attacker).. " killed " ..getPlayerName(source),getRootElement(),255,255,255) 
        end 
    end 
end 
addEventHandler ( "onPlayerWasted", getRootElement(), player_Wasted ) 

Link to comment
I put another player to kill me .

What do you mean by this? Is there another player on your server who can kill you? Or you kill yourself with some function? Because your code seems OK.

UPD: Maybe your meta file is not correct. It should be like this:

    

Link to comment

I'm not sure if anyone here can help you

since your code is fine and it's server-side on meta as you said

it must be something like you forgot to do restart or you have to do refresh for some reason or the script isn't working at all

Just to find out where's the problem

write on F8 debugscript 3

function player_Wasted(_, attacker) 
    outputDebugString("true:1") 
    if attacker then 
        outputDebugString("true:2") 
        if getElementType(attacker) == "player" then 
            outputDebugString("true:3") 
            outputChatBox(getPlayerName(attacker).. " killed " ..getPlayerName(source),getRootElement(),255,255,255) 
        end 
    end 
end 
addEventHandler ( "onPlayerWasted", getRootElement(), player_Wasted ) 

Edited by Guest
Link to comment
function player_Wasted(_, attacker) 
    outputDebugString("true:1") 
    if attacker then 
        outputDebugString("true:2") 
        if getElementType(attacker) == "player" then 
            outputDebugString("true:3") 
            outputChatBox(getPlayerName(attacker).. " killed " ..getPlayerName(source),getRootElement(),255,255,255) 
        end 
    end 
end 
addEventHandler ( "onPlayerWasted", getRootElement(), player_Wasted ) 

it display only "true : 1 " . If script worked must display "test:1" , "test:2" , "test:3" . So script stop working at

if attacker then 

Link to comment

Looks like there is some problem with attacker.

function player_Wasted(_, attacker) 
    outputDebugString(tostring(attacker)) 
    if attacker then 
        outputDebugString("true:2") 
        if getElementType(attacker) == "player" then 
            outputDebugString("true:3") 
            outputChatBox(getPlayerName(attacker).. " killed " ..getPlayerName(source),getRootElement(),255,255,255) 
        end 
    end 
end 
addEventHandler ( "onPlayerWasted", getRootElement(), player_Wasted ) 

What does debugscript output?

Link to comment

No . This isn't full script . But i create a new resource with a server-side function .

function player_Wasted(_, attacker) 
    outputDebugString("true:1") 
    if isElement(attacker) then 
        outputDebugString("true:2") 
        if getElementType(attacker) == "player" then 
            outputDebugString("true:3") 
            outputChatBox(getPlayerName(attacker).. " killed " ..getPlayerName(source),getRootElement(),255,255,255) 
        end 
    end 
end 
addEventHandler ( "onPlayerWasted", getRootElement(), player_Wasted ) 

Still don't working . I dont have new weapons ... i have m4 , ak etc same id but guns are added in a DayZ gamemode . This is the problem ?

Link to comment

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