Evil-Cod3r Posted February 8, 2012 Share Posted February 8, 2012 Hi all i try Make a Sound_Pack System For My GameMode i made this is it right ? function Wasted ( ammo, killer, killerweapon, bodypart ) if ( killer ) and ( killer ~= source ) then local sound = playSound("sounds/1.ogg") setSoundVolume(sound, 1.5) end addEventHandler("onClientPlayerWasted", getLocalPlayer(), wasted) function headshotKill ( attacker, attackerweapon, bodypart, loss ) if bodypart == 9 then local sound = playSound("sounds/2.ogg") setSoundVolume(sound, 1.5) end addEventHandler("onClientPlayerWasted", getLocalPlayer(),headshotKill) function dead () local sound = playSound("sounds/3.ogg") setSoundVolume(sound, 1.5) end addEventHandler("onClientPlayerWasted", getLocalPlayer(), dead ) Link to comment
Castillo Posted February 8, 2012 Share Posted February 8, 2012 function wasted ( killer, killerweapon, bodypart ) if ( killer ) and ( killer ~= source ) then local sound = playSound("sounds/1.ogg") setSoundVolume(sound, 1.5) if (bodypart == 9) then local sound = playSound("sounds/2.ogg") setSoundVolume(sound, 1.5) end else local sound = playSound("sounds/3.ogg") setSoundVolume(sound, 1.5) end end addEventHandler("onClientPlayerWasted", getLocalPlayer(), wasted) Link to comment
Castillo Posted February 8, 2012 Share Posted February 8, 2012 You're welcome. Edit: Copy the script again, "onClientPlayerWasted" doesn't has a "ammo" argument. Link to comment
Evil-Cod3r Posted February 8, 2012 Author Share Posted February 8, 2012 what about this ? function wasted ( killer, killerweapon, bodypart ) if ( killer ) and ( killer ~= source ) then local sound = playSound("sounds/1.ogg") setSoundVolume(sound, 1.5) outputChatBox("**Great Shot Player +$40!**",source,255,255,0) givePlayerMoney ( killer, 40 ) if (bodypart == 9) then local sound = playSound("sounds/2.ogg") setSoundVolume(sound, 1.5) outputChatBox("**OWned->HeadShot +$50**",source,255,255,0) givePlayerMoney ( killer,50 ) end else local sound = playSound("sounds/3.ogg") setSoundVolume(sound, 1.5) outputChatBox("**Woops Your Dead Try Next Time - $5**",source,255,255,0) takePlayerMoney( killer, 5) end end addEventHandler("onClientPlayerWasted", getLocalPlayer(), wasted) and can you help me with this function levelup () local Exp = getElementData(source,"Exp") local Level = getElementData(source,"Level") expLabel = guiCreateLabel(0.777,0.22,0.1708,0.0963,"EXP gained: ??\nTotal EXP: ??\nLevel: Unknown",true) guiLabelSetColor(expLabel,0,255,0) guiLabelSetVerticalAlign(expLabel,"top") guiLabelSetHorizontalAlign(expLabel,"left",false) guiSetFont(expLabel,"clear-normal") guiSetText ( expLabel, "Exp.. Level" ) setTimer ( levelup, 2000, 1) end end Link to comment
Evil-Cod3r Posted February 8, 2012 Author Share Posted February 8, 2012 any small help ? Link to comment
Castillo Posted February 8, 2012 Share Posted February 8, 2012 -- client side: addEvent("playWastedSound",true) addEventHandler("playWastedSound",root, function (thePath) if (thePath and fileExists(thePath)) then local sound = playSound(thePath) setSoundVolume(sound, 1.5) end end) -- server side: addEventHandler("onPlayerWasted", root, function ( ammo, killer, killerweapon, bodypart ) if ( killer ) and ( killer ~= source ) then outputChatBox("**Great Shot Player +$40!**",killer,255,255,0) triggerClientEvent(killer,"playWastedSound",killer,"sounds/1.ogg") givePlayerMoney ( killer, 40 ) if (bodypart == 9) then outputChatBox("**OWned->HeadShot +$50**",killer,255,255,0) triggerClientEvent(killer,"playWastedSound",killer,"sounds/2.ogg") givePlayerMoney ( killer, 50 ) end else outputChatBox("**Woops Your Dead Try Next Time - $5**",source,255,255,0) triggerClientEvent(source,"playWastedSound",source,"sounds/3.ogg") takePlayerMoney( source, 5 ) end end) The other script: function levelup () local Exp = getElementData(localPlayer,"Exp") local Level = getElementData(localPlayer,"Level") if isElement(expLabel) then destroyElement(expLabel) end expLabel = guiCreateLabel(0.777,0.22,0.1708,0.0963,"EXP gained: ??\nTotal EXP: ".. tostring(Exp) .."\nLevel: ".. tostring(Level),true) guiLabelSetColor(expLabel,0,255,0) guiLabelSetVerticalAlign(expLabel,"top") guiLabelSetHorizontalAlign(expLabel,"left",false) guiSetFont(expLabel,"clear-normal") end setTimer ( levelup, 2000, 1) Link to comment
Evil-Cod3r Posted February 9, 2012 Author Share Posted February 9, 2012 Thx Castillo i owe you One ! Link to comment
Castillo Posted February 9, 2012 Share Posted February 9, 2012 You're welcome. P.S: Just one? ;P 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