E-mail Posted September 10, 2011 Share Posted September 10, 2011 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 ! Link to comment
Static-X Posted September 10, 2011 Share Posted September 10, 2011 outputChatBox("text",getRootElement()) Link to comment
AaronZirro Posted September 10, 2011 Share Posted September 10, 2011 (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 September 10, 2011 by Guest Link to comment
Castillo Posted September 10, 2011 Share Posted September 10, 2011 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) Link to comment
AaronZirro Posted September 10, 2011 Share Posted September 10, 2011 I think he wants all players to see the message, not just the killer. Link to comment
Castillo Posted September 10, 2011 Share Posted September 10, 2011 That would make totally no sense, why would others see what you get? P.S: "You Have got M4" YOU, not "Solidsnake14 has received a M4". Link to comment
AaronZirro Posted September 10, 2011 Share Posted September 10, 2011 how to add msg for all players Warning player Name have got M4 For Kill a Noop ! Link to comment
Castillo Posted September 10, 2011 Share Posted September 10, 2011 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. Link to comment
AaronZirro Posted September 10, 2011 Share Posted September 10, 2011 Well I edited my post when I realised that E-mail made mistake. Link to comment
Castillo Posted September 10, 2011 Share Posted September 10, 2011 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!!") Link to comment
E-mail Posted September 10, 2011 Author Share Posted September 10, 2011 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! Link to comment
Castillo Posted September 10, 2011 Share Posted September 10, 2011 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) Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now