Jump to content

Help in give gun and msg ![Please]


E-mail

Recommended Posts

Posted

Hi all

i have made a script if player kill enmey give him m4 with 20 ammo

function xxx (ammo, killer, killerweapon, bodypart ) 
    if (killer) and (killer ~= source ) then 
      giveWeapon ( source, 31, 20 ) 
    outputChatBox("You Have got M4 For Kill The Noob!!",killer,255,255,0) 
    end 
end 
addEventHandler ("onPlayerWasted",getRootElement() , xxx) 

how to add msg for all players

Warning player Name have got M4 For Kill a Noop !

:mrgreen:

Posted (edited)
function xxx (ammo, killer, killerweapon, bodypart ) 
    if (killer) and (killer ~= source ) then 
      giveWeapon ( killer, 31, 20 ) 
    outputChatBox(killer.." Have got M4 For Kill The Noob!!") 
    end 
end 
addEventHandler ("onPlayerWasted",getRootElement() , xxx) 

Edited by Guest
Posted
function xxx (ammo, killer, killerweapon, bodypart ) 
    if (killer) and (killer ~= source ) then 
      giveWeapon ( killer, 31, 20, true ) -- source is the person who died, killer is the one who killed him. 
    outputChatBox("You Have got M4 For Kill The Noob!!", killer) 
    end 
end 
addEventHandler ("onPlayerWasted",getRootElement() , xxx) 

Posted

Well, I didn't read his main post, I just corrected yours, since you wasn't showing it to all, I leaved it like that.

P.S: I know you edited it, but not when I corrected the code.

Posted

I see.

Anyway, your outputChatBox is wrong, you need getPlayerName to get the killer's name.

outputChatBox(tostring(getPlayerName(killer)) .." Have got M4 For Kill The Noob!!") 

Posted

SoldSnake i need msg like this

If killed soldsnake show msg to me you have got....

and For Players Warning ..name.. have got M4 watch out!

:mrgreen:

Posted
function xxx (ammo, killer, killerweapon, bodypart ) 
    if (killer) and (killer ~= source ) then 
      giveWeapon ( killer, 31, 20, true ) 
    outputChatBox(getPlayerName(killer) .." has now a M4, watch out!", getRootElement(), 255, 0, 0) 
    end 
end 
addEventHandler ("onPlayerWasted",getRootElement() , xxx) 

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