Jump to content

simple help :)


K4stic

Recommended Posts

I need help to make this work to then player join on team

Client Side:

function checkbum( ) 
        local thisTeam = getPlayerTeam(getLocalPlayer()) 
        if thisTeam ~= false then 
            if thisTeam == getTeamFromName(Bumsteam) then 
                setElementData ( getLocalPlayer(), "Bumsstatus", "yes" ) 
                local trashspots = getElementsByType ( "trash_spot" ) 
                for trashKey,theTrash in ipairs(trashspots) do 
                    local Tx, Ty, Tz = getElementPosition( theTrash ) 
                    local trashBlip = createBlipAttachedTo ( theTrash, 39, 1, 0, 0, 0, 0, 0, 100) 
                    setElementParent ( trashBlip, theTrash ) 
                end 
                myRCs = { } 
                local recyclecenters = getElementsByType ( "recycle_center" ) 
                for rcKey,theRC in ipairs(recyclecenters) do 
                    local Tx, Ty, Tz = getElementPosition( theRC ) 
                    theRBlip = exports.customblips:createCustomBlip ( Tx, Ty, 20, 20, "img/recy1.png" ) 
                end 
            else 
                setElementData ( getLocalPlayer(), "Bumsstatus", "no" ) 
                local trashblips = getElementsByType ( "blip" ) 
                for trashKey,theTrashBlip in ipairs(trashspots) do 
                    if (getElementData( theTrashBlip, "purpose" ) == "trash") then 
                        destroyElement(theTrashBlip) 
                    end 
                end 
            destroyElement(theRBlip) 
        end 
    end 
end 
addEventHandler("onClientPlayerJoin", root, checkbum) 
addEventHandler("onClientResourceStart", root, checkbum) 

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