• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

War System - Bug?!

Status
Not open for further replies.

GarQet

Own3d!
Joined
Feb 10, 2009
Messages
1,381
Solutions
14
Reaction score
81
Witam mam chyba dość nietypowy problem, a mianowicie:
help.png

Jest tak że system zalicza fragi dla danej drużyny po zdobytych fragach za osobę która padła. Czy jest ktoś w stanie mi pomóc? Co może być źle?
Te osoby sfragowały tego Sunny a do WarSystemu dodało się im 8pkt. Bo skrypt policzył że ta osoba padła 8 razy, bo została przez 4 osoby sfragowana. A tak nie powinno być. W ogóle to jak jedna osoba zabije drugą, to skrypt nalicza 2 fragi, a powinien jeden.
Używam TFS 0.3.5pl1 i korzystałem z skryptu: http://otland.net/f81/fixed-guild-w...not-count-frags-forgotten-server-0-3-a-32157/

Proszę o pomoc.
 
W sumie, tego się spodziewałem, widocznie wyczerpałem limit roczny na otlandzie.
Można zamknąć ten temat.
 
sproboj dac update tego skryptu:
Code:
dofile("./GuildWar.lua")

local PZ = createConditionObject(CONDITION_INFIGHT)
setConditionParam(PZ, CONDITION_PARAM_TICKS, getConfigInfo('whiteSkullTime'))

function onKill(cid, target, lastHit)
        if isPlayer(cid) == TRUE and isPlayer(target) == TRUE then
                local myGuild = getPlayerGuildId(cid)
                local enemyGuild = getPlayerGuildId(target)
                if myGuild ~= 0 and enemyGuild ~= 0 then
                        if enemyGuild == getGuildWarInfo(myGuild).With then
                                doAddCondition(cid, PZ)
                                doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "This frag will not count!")
                                if lastHit == TRUE then
                                        registerDeath(myGuild, enemyGuild, cid, target)
                                end
                        end
                end
        end
        return TRUE
end
 
@up
Głupota, serwer przerobi cały skrypt, wykona w chuj sprawdzeń a dopiero na końcu czy lastHit jest prawdziwy? :(
 
Okazuje się że jest totalnie coś zrypane, bo war system dołącza nawet te dedy które są przez inne osoby nie włączone w WARA... Coś jest nie tak :/
Pietia jutro spróbuję to co dałeś i napiszę czy coś się zmieniło.
 
LUA:
function onKill(cid, target, lastHit)

if(not lastHit) then
	return true
end

wczesniej jeszcze mozna dodac sprawdzenie czy cid i target sa graczami i skrypt cały się nie wykonuje, a o ile się nie myle tam pare zapytań mysql jest
 
Pomimo tego BUGA, nie wiem czy każdy tak ma ale parę graczy np. ma pokazane:
np:
6 Nov 2009, 13:30 Slain at Level 144 by Gtv, Rr, Rr, Rr and Rr.
4 razy wypisało postać o nicku Rr... :(

EDIT
Nic nie dało :/
Ja wgl. nie mam takiej funkcji jak Specjalist napisal z tym onHit czy coś takiego.
 
Last edited:
LUA:
function onKill(cid, target, lastHit)

if(not lastHit) then
	return true
end

wczesniej jeszcze mozna dodac sprawdzenie czy cid i target sa graczami i skrypt cały się nie wykonuje, a o ile się nie myle tam pare zapytań mysql jest

z tym ze jeszcze muszisz sprawdzic czy dany gracz walczy przeciw innemu graczowi ;[
 
z tym ze jeszcze muszisz sprawdzic czy dany gracz walczy przeciw innemu graczowi ;[

no oczywiscie, ze tak, ale po co to sprawdzac przed sprawdzeniem czy lastHit = true? co jest lepsze, sprawdzenie lastHit i jezeli false to koniec wykonywania skryptu, czy moze wykonaniu paru zapytan sql, kilka warunków, sprawdzenie czy lastHit jest równy false i dopiero zakończenie skryptu?
nawet 19 razy skrypt sie moze wykonywac niepotrzebnie, no ale nic ludzie rozne gusta maja xD
 
LUA:
dofile("./GuildWar.lua")
local PZ = createConditionObject(CONDITION_INFIGHT)
setConditionParam(PZ, CONDITION_PARAM_TICKS, getConfigInfo('whiteSkullTime'))

function onKill(cid, target, lastHit)

	if(not lastHit) then	
		return true
	end
	
	if(not isPlayer(cid) and not isPlayer(target)) then
		return true
	end
	
	if(getPlayerGuildId(cid) == 0 and getPlayerGuildId(target) == 0) then
		return true
	end
	
	if(getPlayerGuildId(target) == getGuildWarInfo(getPlayerGuildId(cid)).With) then
		doAddCondition(cid, PZ)
		doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "This frag will not count!")
		registerDeath(getPlayerGuildId(cid), getPlayerGuildId(target), cid, target)
	end
	return true
end
takie coś mogłoby być bardziej sexxxxxxxxxxxxxxxxxxxxxxxxxxxx czom?
 
Status
Not open for further replies.
Back
Top