• 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!

Exp za graczy na PVP-E

Dymek

New Member
Joined
Dec 30, 2008
Messages
54
Reaction score
1
Location
Poland
Witam !

Mam problem z dostawaniem expa za graczy.
Silnik: TFS 0.3.6pl1
Otóż, oczywiście w configu mam zmienione na:
worldType = "pvp"
minLevelThresholdForKilledPlayer = 0.0
maxLevelThresholdForKilledPlayer = 0.0
rateExperienceFromPlayers = 40.0
Za zabitych pierwszych pięciu graczy dostaje expa, ale jak już zabije szóstego(i więcej) to w ogóle owego expa nie dostaje.

W czym problem ?
 
12 leveli to jest już za duża różnica ? (112 level zabija 100)
 
Dymek, tak przynajmniej tak jest na moim enfo ;)

że 14 lvl zabijając 11 lvl nie dostaje expa
 
No to w takim bądź razie, jest jakiś skrypt że jak się zabije gracza obojętnie na jakim lvl to daje nam np. 1 mln expa/5 lvl ?

Jeżeli tak, to byście dali link do tematu? ; \
 
@up
skrypta trzeba napisac :peace: ja taki pisałem dla siebie i chodzi :] ale nie udostepnie
 
masz, mozesz sobie przerobic jezeli posiadasz troche mozgu w innym wypadku dawaj 8 € na topa i ci to zrobie.

Code:
local config =
{
	killsCount = 3943,
	levels =
	{
		{100, 135, 5807, 1, 2},
		{135, 150, 5806, 1, 4},
		{150, 450, 5805, 1, 6},
	},
	skulls =
	{
		{SKULL_GREEN, 10}, 
		{SKULL_YELLOW, 25},
		{SKULL_WHITE, 40}, 
		{SKULL_RED, 60}
	}
}

function onKill(cid, target, lastHit)
	if(not isPlayer(cid) or not isPlayer(target)) then
		return true
	end

	if(not lastHit) then
		return true
	end

	if(getPlayerStorageValue(cid, getPlayerIp(target)) == 5) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You won't get frags and exp by killing this player ([ANTY FRAGGING SYSTEM])")
		return true
	end

	if(getPlayerIp(cid) == getPlayerIp(target)) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "You won't get frags by killing yourself (This same IP!)")
		return true
	end

	if(getPlayerName(cid) == getPlayerName(target)) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You won't get frags by killing yourself!")
		return true
	end
	
	local kills = getPlayerStorageValue(cid, config.killsCount)
	if(kills == -1) then
		kills = 0
	end

	frags.add(cid, 1)
	setPlayerStorageValue(cid, config.killsCount, kills + 1)
	
	local frags = getPlayerStorageValue(cid, config.killsCount)
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "You owned " .. getPlayerName(target) .. "! You have now " .. frags .. " frags!")
	for i, v in ipairs(config.skulls) do
		if(frags >= v[2]) then
			doCreatureSetSkullType(cid, v[1])
		end
	end
	local level = getPlayerLevel(target)
	for i, v in ipairs(config.levels) do
		if(level >= v[1] and level < v[2]) then
			local item = doPlayerAddItem(cid, v[3], v[4])
			doItemSetAttribute(item, "description", "Reward for kill " .. getPlayerName(target) .. " at level " .. getPlayerLevel(target) .. ".")
			break
		end
	end	
	return true
end
 
Daj mi tylko to co muszę wpisać do creaturescripts.xml, dalej sobie poradzę.
 
Wyraźnie napisał.

W-g mnie:
Lua:
<event type="kill" name="FragReward" script="frag_reward.lua"/>
ale moge się mylić:)

+ w login.lua
Lua:
registerCreatureEvent(cid, "FragReward")

Co do repp:
Możesz, nie musisz
 
Back
Top