Jump to content

help


Recommended Posts

Posted
Hey, i'm using tactics gamemode and i wanted to hide the bilps of the team 'tactics' to the other team

what should i do?

use this function

setElementVisibleTo () 

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted
Hey, i'm using tactics gamemode and i wanted to hide the bilps of the team 'tactics' to the other team

what should i do?

use this function

setElementVisibleTo () 

Thanks walid

and how do destroy the blip of the team tactics. I mean it should not be visible to anyone.

Posted

Thanks walid

and how do destroy the blip of the team tactics. I mean it should not be visible to anyone.

try to use

destroyElement() 

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted

not working

    addEventHandler ( "onResourceStart", resourceRoot, 
        function ( ) 
            for _, player in ipairs ( getElementsByType ( "player" ) ) do 
                local attached = getAttachedElements ( player ) 
                if ( attached ) then 
                    for _, element in ipairs ( attached ) do if ( getTeamName ( source ) == "tactics" ) and 
         if ( getElementType ( element ) == "blip" ) then 
                            destroyElement ( element ) 
                        end 
                    end 
                end 
            end 
       end 
    ) 
     

Posted

and also this isn't working

trying to make tactis team fire proof

addEventHandler ( "onClientPlayerDamage", localPlayer,  
function() 
    if ( weapon == 37 )  and ( getTeamName (source) == "tactics" ) then 
        cancelEvent() 
        
    end 
end) 

sorry i'm not that good at lua, just trying make script from wiki and forum examples.

Posted

it must be like this

addEventHandler ( "onResourceStart", resourceRoot, 
    function ( ) 
        for _, player in ipairs ( getElementsByType ( "player" ) ) do 
            local attached = getAttachedElements (player) 
                if ( attached ) then 
                local playerTeam = getPlayerTeam(player)  
                if (playerTeam) then 
                    if ( getTeamName (playerTeam) == "tactics" ) then 
                        for _, element in ipairs (attached) do  
                            if (getElementType (element) == "blip" ) then 
                            destroyElement ( element ) 
                        end 
                    end 
                end 
            end 
       end 
    end  
end) 

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted
Tysm Walid :)

What about my second question?

What's wrong in the script?

np , about the second question sorry i don't undrestand what you want exactly

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted
Tysm Walid :)

What about my second question?

What's wrong in the script?

np , about the second question sorry i don't undrestand what you want exactly

I don't want the team tactics get damage from fire.

Posted
and also this isn't working

trying to make tactis team fire proof

addEventHandler ( "onClientPlayerDamage", localPlayer,  
function() 
    if ( weapon == 37 )  and ( getTeamName (source) == "tactics" ) then 
        cancelEvent() 
        
    end 
end) 

sorry i'm not that good at lua, just trying make script from wiki and forum examples.

addEventHandler ( "onClientPlayerDamage", root,

function()

if getTeamName (source) == "tactics" then

cancelEvent()

end

end)

Posted

Try this one

addEventHandler ( "onClientPlayerDamage", localPlayer, 
function() 
    local playerTeam = getPlayerTeam(source) 
    if playerTeam and  
        if ( weapon == 37 )  and ( getTeamName(playerTeam) == "tactics" ) then 
        cancelEvent() 
       end 
    end 
end  
) 

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted
Try this one
addEventHandler ( "onClientPlayerDamage", localPlayer, 
function() 
    local playerTeam = getPlayerTeam(source) 
    if playerTeam and  
        if ( weapon == 37 )  and ( getTeamName(playerTeam) == "tactics" ) then 
        cancelEvent() 
       end 
    end 
end  
) 

Tysm i'll try this.

Posted

Not working

Error: unexpected symbol near 'if'

line 5

addEventHandler ( "onClientPlayerDamage", localPlayer, 
function() 
    local playerTeam = getPlayerTeam(source) 
    if playerTeam and  
        if ( weapon == 37 )  and ( getTeamName(playerTeam) == "tactics" ) then 
        cancelEvent() 
       end 
    end 
end  
) 

Posted

You must add the argument weapon.

addEventHandler ( "onClientPlayerDamage", localPlayer, 
function( attacker, weapon, bodypart ) 
    local playerTeam = getPlayerTeam(source) 
    if playerTeam and 
        if ( weapon == 37 )  and ( getTeamName(playerTeam) == "tactics" ) then 
        cancelEvent() 
       end 
    end 
end 
) 

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted
Not working

Error: unexpected symbol near 'if'

line 5

addEventHandler ( "onClientPlayerDamage", localPlayer, 
function() 
    local playerTeam = getPlayerTeam(source) 
    if playerTeam and  
        if ( weapon == 37 )  and ( getTeamName(playerTeam) == "tactics" ) then 
        cancelEvent() 
       end 
    end 
end  
) 

  
addEventHandler ( "onClientPlayerDamage", localPlayer, 
function( attacker, weapon, bodypart ) 
    local playerTeam = getPlayerTeam(source) 
    local attackerTeam = getPlayerTeam(attacker) 
    if playerTeam and attackerTeam 
        if (getTeamName(attackerTeam) == "tactics") and ( getTeamName(playerTeam) == "tactics" ) then 
        cancelEvent() 
       end 
    end 
end 
) 

Posted

it must be like this :

addEventHandler ( "onClientPlayerDamage", localPlayer, 
    function( attacker, weapon, bodypart ) 
        if attacker and isElement(attacker) and getElementType(attcker) == "player" and attacker ~= source then   
            if (getTeamName(getPlayerTeam(attacker)) == "tactics") and (getTeamName(getPlayerTeam(source)) == "tactics") then  
            cancelEvent() 
       end 
    end 
end  
) 

Edit

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted
it must be like this :
addEventHandler ( "onClientPlayerDamage", localPlayer, 
    function( attacker, weapon, bodypart ) 
        if attacker and isElement(attacker) and getElementType(attcker) == "player" and attacker ~= source then   
            if (getTeamName(getPlayerTeam(attacker)) == "tactics") and (getTeamName(getPlayerTeam(source)) == "tactics") then  
            cancelEvent() 
       end 
    end 
end  
) 

Edit

Agreed

Posted
That's not what i asked, I'm trying make team tactics don't get damage from fire.

Id 37

i already gave it to you

addEventHandler ( "onClientPlayerDamage", localPlayer, 
function( attacker, weapon, bodypart ) 
    local playerTeam = getPlayerTeam(source) 
    if playerTeam and 
        if ( weapon == 37 )  and ( getTeamName(playerTeam) == "tactics" ) then 
        cancelEvent() 
       end 
    end 
end 
) 

untested

you must read this about death reason : Here

When a player was shot by a weapon, the respective weapon ID is the death reason ID

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted
That's not what i asked, I'm trying make team tactics don't get damage from fire.

Id 37

i already gave it to you

addEventHandler ( "onClientPlayerDamage", localPlayer, 
function( attacker, weapon, bodypart ) 
    local playerTeam = getPlayerTeam(source) 
    if playerTeam and 
        if ( weapon == 37 )  and ( getTeamName(playerTeam) == "tactics" ) then 
        cancelEvent() 
       end 
    end 
end 
) 

untested

you must read this about death reason : Here

When a player was shot by a weapon, the respective weapon ID is the death reason ID

thanks you soo much, There was one Error anyway i've fixed it

and one more question

I want players to die in 1 second with every weapon expect explostion

addEventHandler("onPlayerDamage", getRootElement() , 
function (attacker, weapon, bodypart, loss) 
    killPed(source,attacker,weapon) 
  if weapon == 51  then 
    cancelEvent() 
end 
end 
) 
   

not working and no error

wanted to cancle the event from id 51, they die in 1 second even with explstion.

Posted
onPlayerDamage can't be canceled

instead on cancling onPlayerDamage you have to cancle onClientPlayerDamage

Killped is server side function.

what should i do?

Posted
onPlayerDamage can't be canceled

instead on cancling onPlayerDamage you have to cancle onClientPlayerDamage

Killped is server side function.

what should i do?

use

triggerServerEvent() 

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

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