Jump to content

help with killmessages


Kenix

Recommended Posts

please help I want to do that after a knife displays.

but script not work :?

  
function ZombieKillmessage(ammo, attacker, weapon, bodypart) 
if ( weapon == 4 ) then 
      local sourceTeam,killerTeam = getPlayerTeam(source),getPlayerTeam(killer) 
      local rK,gK,bK = getPlayerNametagColor(killer) 
      local rS,gS,bS = getPlayerNametagColor(source) 
      exports.killmessages:outputMessage( 
         {getPlayerName(killer),{"padding",width=3},{"icon",id=waffe},{"padding",width=3}, 
         {"icon",id=256},{"padding",width=3},{"color",r=rS,g=gS,b=bS},getPlayerName(source)}, 
         getRootElement(),rK,gK,bK) 
        end 
end      
addEventHandler("onPlayerDamage",getRootElement(),ZombieKillmessage) 
  

Link to comment

help please :(

may be problem in outputMessage

use debug no errors

  
function ZombieKillmessage(ammo, attacker, weapon, bodypart) 
if ( weapon == 4 ) then 
      local sourceTeam,killerTeam = getPlayerTeam(source),getPlayerTeam(attacker) 
      local rK,gK,bK = getPlayerNametagColor(attacker) 
      local rS,gS,bS = getPlayerNametagColor(source) 
      exports.killmessages:outputMessage( 
         {getPlayerName(attacker),{"padding",width=3},{"icon",id=waffe},{"padding",width=3}, 
         {"icon",id=256},{"padding",width=3},{"color",r=rS,g=gS,b=bS},getPlayerName(source)}, 
         getRootElement(),rK,gK,bK) 
        end 
end      
addEventHandler("onPlayerDamage",getRootElement(),ZombieKillmessage) 
  

Link to comment

volk-rus i dont know if someone tell you this before, but you can not make a script by copying random parts of other people code...

i mean this

exports.killmessages:outputMessage( 
       {getPlayerName(attacker),{"padding",width=3},{"icon",id=waffe},{"padding",width=3}, 
         {"icon",id=256},{"padding",width=3},{"color",r=rS,g=gS,b=bS},getPlayerName(source)}, 
          getRootElement(),rK,gK,bK) 

it is a copy, paste from the link Citizen give you, and you even dont know whot this code do (not many people know, as there is no wiki page for killmessages)

i see at lest two errors in youre cod ("use debug no errors" my ass)

function ZombieKillmessage(ammo, attacker, weapon, bodypart) 

"ammo" contains "atacker"

"atacker" contains "weapon"

"weapon" contains " bodypart"

" bodypart" contains hp loss

https://wiki.multitheftauto.com/wiki/OnPlayerDamage

also you use "waffe" that is not define in you're script (waffe means weapon in german)

exports.killmessages:outputMessage({getPlayerName(attacker),{"padding",width=3},{"icon",id=weapon},{"padding",width=3},{"color",r=rS,g=gS,b=bS},getPlayerName(source)},getRootElement(),rK,gK,bK) 

first parameter is "tekst" and it can be a string or a table, second parameter is "visible for" and it can be ane player, or root element for all players, last parameters are "red","green","blue"

in the table {"padding",width=3} is a 3 pixel space, rest should be obvious

Link to comment
volk-rus i dont know if someone tell you this before, but you can not make a script by copying random parts of other people code...

i mean this

exports.killmessages:outputMessage( 
       {getPlayerName(attacker),{"padding",width=3},{"icon",id=waffe},{"padding",width=3}, 
         {"icon",id=256},{"padding",width=3},{"color",r=rS,g=gS,b=bS},getPlayerName(source)}, 
          getRootElement(),rK,gK,bK) 

it is a copy, paste from the link Citizen give you, and you even dont know whot this code do (not many people know, as there is no wiki page for killmessages)

i see at lest two errors in youre cod ("use debug no errors" my ass)

function ZombieKillmessage(ammo, attacker, weapon, bodypart) 

"ammo" contains "atacker"

"atacker" contains "weapon"

"weapon" contains " bodypart"

" bodypart" contains hp loss

https://wiki.multitheftauto.com/wiki/OnPlayerDamage

also you use "waffe" that is not define in you're script (waffe means weapon in german)

exports.killmessages:outputMessage({getPlayerName(attacker),{"padding",width=3},{"icon",id=weapon},{"padding",width=3},{"color",r=rS,g=gS,b=bS},getPlayerName(source)},getRootElement(),rK,gK,bK) 

first parameter is "tekst" and it can be a string or a table, second parameter is "visible for" and it can be ane player, or root element for all players, last parameters are "red","green","blue"

in the table {"padding",width=3} is a 3 pixel space, rest should be obvious

thanks a lot dude, this script is running)

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