Jump to content

pickup hit


OrbTanT

Recommended Posts

How can I set a effect, when player pass above the pickup, I tried to use createEffect, more not working with pickup.

server

  
addEventHandler("onPickupHit", grovepickup, 
function (player) 
    local playerTeam = getPlayerTeam(player) 
    if (playerTeam) then 
        local r, g, b = getTeamColor(playerTeam) 
        local aR, aG, aB = getRadarAreaColor(GROVE)   
        if (r == aR) and (g == aG) and (b == aB) then 
            outputChatBox("", player, 0, 0, 0, true) 
        else 
            outputChatBox("#F4A460[AVISO]#F08080 Você não faz parte desta gang.", player, 0, 0, 0, true) 
            cancelEvent() 
        end 
    else 
        outputChatBox("#F4A460[AVISO]#F08080 Você não faz parte desta gang.", player, 0, 0, 0, true) 
        cancelEvent() 
    end 
end) 

Link to comment

I tried to use this script, more is not working

client

function onPickupHitShow ( thePlayer ) 
    local pickupType = getPickupType ( source ) 
    local x, y, z = getElementPosition(localPlayer) 
    if (pickupType == 1) then 
        fxAddSparks( x, y, z, x+10, y+10, z+10) 
    end 
end 
addEventHandler ( "onPickupHit", getRootElement(), onPickupHitShow ) 

server

    c4 = createPickup ( 2511.323, -1688.844, 13.549, 1, 15, 0 ) 
  
addEventHandler("onPickupHit", c4, 
function (player) 
    local playerTeam = getPlayerTeam(player) 
    if (playerTeam) then 
        local r, g, b = getTeamColor(playerTeam) 
        local aR, aG, aB = getRadarAreaColor(GROVE)   
        if (r == aR) and (g == aG) and (b == aB) then 
            outputChatBox("", player, 0, 0, 0, true) 
        else 
            outputChatBox("#F4A460[AVISO]#F08080 Você não faz parte desta gang.", player, 0, 0, 0, true) 
            cancelEvent() 
        end 
    else 
        outputChatBox("#F4A460[AVISO]#F08080 Você não faz parte desta gang.", player, 0, 0, 0, true) 
        cancelEvent() 
    end 
end) 

Link to comment
I tried to use this script, more is not working

client

function onPickupHitShow ( thePlayer ) 
    local pickupType = getPickupType ( source ) 
    local x, y, z = getElementPosition(localPlayer) 
    if (pickupType == 1) then 
        fxAddSparks( x, y, z, x+10, y+10, z+10) 
    end 
end 
addEventHandler ( "onPickupHit", getRootElement(), onPickupHitShow ) 

server

    c4 = createPickup ( 2511.323, -1688.844, 13.549, 1, 15, 0 ) 
  
addEventHandler("onPickupHit", c4, 
function (player) 
    local playerTeam = getPlayerTeam(player) 
    if (playerTeam) then 
        local r, g, b = getTeamColor(playerTeam) 
        local aR, aG, aB = getRadarAreaColor(GROVE)   
        if (r == aR) and (g == aG) and (b == aB) then 
            outputChatBox("", player, 0, 0, 0, true) 
        else 
            outputChatBox("#F4A460[AVISO]#F08080 Você não faz parte desta gang.", player, 0, 0, 0, true) 
            cancelEvent() 
        end 
    else 
        outputChatBox("#F4A460[AVISO]#F08080 Você não faz parte desta gang.", player, 0, 0, 0, true) 
        cancelEvent() 
    end 
end) 

Great Job , using

'onPickupHit' 

-- server

with localPlayer ---client

and

getPickupType ( source ) 

---- it sould be thePlayer

?

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