Jump to content

mostrar kills e deaths da pessoa no chat


Recommended Posts

ola pessoal, andei pesquisando e tentando fazer um script que quando eu der /stats ele aparecera as mortes as kills e o KD(ratio) mais por algum motivo n sei pq esta dando errado olhem os codigos e pfv me ajudem com isso.

Codigo server: 

function chat( sourcePlayer, commandName, targetPlayerName )
        if ( thePlayer ) then
            local kills = getPlayerKills( getLocalPlayer() )
            local deaths = getPlayerDeaths( getLocalPlayer() )
            outputChatBox ( "O Player"..getPlayerName(player).."Tem"..kills.."/"..deaths"", root, 255, 255, 255, true )
end
end
addCommandHandler("stats", chat)

Codigo Client:

function kills()
    setElementData ( getLocalPlayer ( ), "kills", 0 ) 
end
addEventHandler ( "onClientResourceStart", resourceRoot, kills )

o KD(ratio) n testei por  enquanto mais se vcs quiserem ja colocar pra me ajudar eu ficaria muito grato

 

OBS: Nao deu nenhum erro mais tambem n apareceu no chat quando eu digitava /stats

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