• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Solved No damage to teammates TFS 1.0

narko

vertrauenswürdig ~
Joined
Oct 19, 2008
Messages
1,317
Solutions
2
Reaction score
131
Location
Unknown
Code:
function onStatsChange(cid, attacker, type, combat, value)
    if type == 1 and getCreatureHealth(cid) <= value then
        if(getGlobalStorageValue(33165) == 1) then
                elseif isPlayer(attacker) and isPlayer(cid) then
                    if isPlayer then
                        if tostring(getPlayerStorageValue(cid, 16391)) == tostring(getPlayerStorageValue(cid, 16391)) then
                            return false
                        end
                    end
                end
                return true
            end
    end

I've been trying something like this, but when a player attacks an enemie it hits no DMG and when attacks a teammate either. @Limos just tagging you if you'd like to help me :)
 
Last edited:
@Limos

This code is working fine, but there's an issue when other players that aren't in the event can't attack each others, did I miss a condition?

Code:
local player, attacker = Player(cid), Player(attacker)
if (type == 1 or type == 3) and attacker and (player:getStorageValue(t.f_1) == attacker:getStorageValue(t.f_1) or player:getStorageValue(t.f_2) == attacker:getStorageValue(t.f_2)) then
           return false
end
return true
end
 
Is there an extra player storage in the event? If not, you can check if they both have the value from the event.
Code:
((player:getStorageValue(t.f_1) == 1 and attacker:getStorageValue(t.f_1) == 1) or (player:getStorageValue(t.f_2) == 1 and attacker:getStorageValue(t.f_2) == 1))
 
Back
Top