Jump to content

Small Thing in Here


Evil-Cod3r

Recommended Posts

Posted

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 ) 

My in-game nick is |['Dev-PoinT_SA']|

addEventHandler ( "onPlayerSpawn", getRootElement(),

function()

if (getPlayerName(source) == "Dev-PoinT") and (getPlayerTeam == "Admin") then

triggerClientEvent("BlaBlaBla",getRootElement())

DxDrawText("Hi Dev-PoinT")

end

end)

Posted
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) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Thx Castillo :D

My in-game nick is |['Dev-PoinT_SA']|

addEventHandler ( "onPlayerSpawn", getRootElement(),

function()

if (getPlayerName(source) == "Dev-PoinT") and (getPlayerTeam == "Admin") then

triggerClientEvent("BlaBlaBla",getRootElement())

DxDrawText("Hi Dev-PoinT")

end

end)

Posted

You're welcome.

Edit: Copy the script again, "onClientPlayerWasted" doesn't has a "ammo" argument.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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 

My in-game nick is |['Dev-PoinT_SA']|

addEventHandler ( "onPlayerSpawn", getRootElement(),

function()

if (getPlayerName(source) == "Dev-PoinT") and (getPlayerTeam == "Admin") then

triggerClientEvent("BlaBlaBla",getRootElement())

DxDrawText("Hi Dev-PoinT")

end

end)

Posted

any small help ?

My in-game nick is |['Dev-PoinT_SA']|

addEventHandler ( "onPlayerSpawn", getRootElement(),

function()

if (getPlayerName(source) == "Dev-PoinT") and (getPlayerTeam == "Admin") then

triggerClientEvent("BlaBlaBla",getRootElement())

DxDrawText("Hi Dev-PoinT")

end

end)

Posted

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

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Thx Castillo i owe you One !

My in-game nick is |['Dev-PoinT_SA']|

addEventHandler ( "onPlayerSpawn", getRootElement(),

function()

if (getPlayerName(source) == "Dev-PoinT") and (getPlayerTeam == "Admin") then

triggerClientEvent("BlaBlaBla",getRootElement())

DxDrawText("Hi Dev-PoinT")

end

end)

Posted

You're welcome.

P.S: Just one? ;P

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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