Jump to content

Turf system


TheIceman1

Recommended Posts

Posted

You forgot to pass the player argument here:

        beachturfTimer = setTimer ( 
            function ( player ) 
                setRadarAreaColor ( beachTurfA, tonumber(r), tonumber(g), tonumber(b), 100 ) 
                exports ["guimessages"] : outputServer ( player, "Congratulations,your gang take this turf!" , 255, 0, 0 ) 
                givePlayerMoney ( player, 2000 ) 
                setRadarAreaFlashing ( beachTurfA, false ) 
            end 
            ,10000, 1 
        ) 

Like this:

            ,10000, 1, player 

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
You forgot to pass the player argument here:
        beachturfTimer = setTimer ( 
            function ( player ) 
                setRadarAreaColor ( beachTurfA, tonumber(r), tonumber(g), tonumber(b), 100 ) 
                exports ["guimessages"] : outputServer ( player, "Congratulations,your gang take this turf!" , 255, 0, 0 ) 
                givePlayerMoney ( player, 2000 ) 
                setRadarAreaFlashing ( beachTurfA, false ) 
            end 
            ,10000, 1 
        ) 

Like this:

            ,10000, 1, player 

Working,how to do that all players in the turf receive money and messages from my gang?

Need paid scripter just pm me i will accept every job!

Posted
getElementColShape -- To obtain marker colshape. 
getElementsWithinColShape -- To obtain a table with player elements inside colshape. 

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

Is it good?

function beachTurf ( player ) 
    local playerGang = getElementData ( player, "gang" ) 
    if ( playerGang ) then 
    local beachTurfCplayers = getElementColShape( beachTurfC ) 
        local players = getElementsWithinColShape ( beachTurfC, "player" ) 
        local r, g, b = unpack ( exports [ "gang_system" ]:getGangColor ( playerGang ) ) 
        setRadarAreaFlashing ( beachTurfA, true ) 
        exports ["guimessages"] : outputServer ( player, "You entered the turf!" , 255, 0, 0 ) 
        beachturfTimer = setTimer ( 
            function ( player ) 
                setRadarAreaColor ( beachTurfA, tonumber(r), tonumber(g), tonumber(b), 100 ) 
                exports ["guimessages"] : outputServer ( players, "Congratulations,your gang take this turf!" , 255, 0, 0 ) 
                givePlayerMoney ( players, 2000 ) 
                setRadarAreaFlashing ( beachTurfA, false ) 
            end 
            ,10000, 1, player 
        ) 
    end 
end 
addEventHandler ( "onColShapeHit", beachTurfC, beachTurf ) 

Need paid scripter just pm me i will accept every job!

Posted

No, "players" is a table of elements, you must loop it.

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

How to do that, only players from my gang get the message and the money?

if isElementWithinColShape( player, beachTurfC ) then 
                exports ["guimessages"] : outputServer ( player, "Congratulations,your gang take this turf!" , 255, 0, 0 ) 
                givePlayerMoney ( player, 2000 ) 

Need paid scripter just pm me i will accept every job!

Posted
function beachTurf ( player ) 
    local playerGang = getElementData ( player, "gang" ) 
    if ( playerGang ) then 
        if ( isTimer ( beachturfTimer ) ) then 
            return 
        end 
  
        local r, g, b = unpack ( exports [ "gang_system" ]:getGangColor ( playerGang ) ) 
        setRadarAreaFlashing ( beachTurfA, true ) 
        exports ["guimessages"] : outputServer ( player, "You entered the turf!" , 255, 0, 0 ) 
        beachturfTimer = setTimer ( 
            function ( ) 
                local beachTurfCplayers = getElementColShape ( beachTurfC ) 
                local players = getElementsWithinColShape ( beachTurfC, "player" ) 
                setRadarAreaColor ( beachTurfA, tonumber(r), tonumber(g), tonumber(b), 100 ) 
                for _, player in ipairs ( players ) do 
                    exports ["guimessages"] : outputServer ( player, "Congratulations, your gang take this turf!" , 255, 0, 0 ) 
                    givePlayerMoney ( player, 2000 ) 
                end 
                setRadarAreaFlashing ( beachTurfA, false ) 
            end 
            ,10000, 1 
        ) 
    end 
end 
addEventHandler ( "onColShapeHit", beachTurfC, beachTurf ) 

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
function beachTurf ( player ) 
    local playerGang = getElementData ( player, "gang" ) 
    if ( playerGang ) then 
        if ( isTimer ( beachturfTimer ) ) then 
            return 
        end 
  
        local r, g, b = unpack ( exports [ "gang_system" ]:getGangColor ( playerGang ) ) 
        setRadarAreaFlashing ( beachTurfA, true ) 
        exports ["guimessages"] : outputServer ( player, "You entered the turf!" , 255, 0, 0 ) 
        beachturfTimer = setTimer ( 
            function ( ) 
                local beachTurfCplayers = getElementColShape ( beachTurfC ) 
                local players = getElementsWithinColShape ( beachTurfC, "player" ) 
                setRadarAreaColor ( beachTurfA, tonumber(r), tonumber(g), tonumber(b), 100 ) 
                for _, player in ipairs ( players ) do 
                    exports ["guimessages"] : outputServer ( player, "Congratulations, your gang take this turf!" , 255, 0, 0 ) 
                    givePlayerMoney ( player, 2000 ) 
                end 
                setRadarAreaFlashing ( beachTurfA, false ) 
            end 
            ,10000, 1 
        ) 
    end 
end 
addEventHandler ( "onColShapeHit", beachTurfC, beachTurf ) 

Working,thanks!

Need paid scripter just pm me i will accept every job!

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