Ir para conteúdo
  • Cadastre-se

[Duvida] para que serve esse script?


Posts Recomendados

function onKill(cid, target)

--config----------------------------

local lvl = getPlayerLevel(cid) --players level

local nlvl = getPlayerLevel(cid) + 5 -- add 5 levels

--end-------------------------------

if isPlayer(target) == TRUE then

if getPlayerIp(cid) ~= getPlayerIp(target) then

local exp = (50 * (lvl) * (lvl) * (lvl) - 150 * (lvl) * (lvl) + 400 * (lvl)) / 5

local nexp = (50 * (nlvl) * (nlvl) * (nlvl) - 150 * (nlvl) * (nlvl) + 400 * (nlvl)) / 5

local newexp = nexp - exp

doPlayerAddExp(cid,newexp)

doSendAnimatedText(getPlayerPosition(cid), "Orgasmic~", 198)

else

doPlayerAddExperience(cid, -50000)

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You have been punished for killing a player of the same IP.")

end

end

return TRUE

end

para que serve isso so pra saber...

Link para o post
Compartilhar em outros sites

Renato respondeu primeiro /\

Editado por Hayashii (veja o histórico de edições)

Se o mundo é mesmo parecido com o que vejo,

Prefiro acreditar no mundo do meu jeito.

( - Renato Russo)

Link para o post
Compartilhar em outros sites

You have been punished for killing a player of the same IP.

Creio que seja uma punição por matar muitas vezez um players do mesmo IP sagysaghsagygasysagygyas

Link para o post
Compartilhar em outros sites

acabei de tirar esse script do ot, mais quando morre o players sempre volta pro lv 1....

é alguma coisa no login?

local config = {

loginMessage = getConfigValue('loginMessage')

}

function onLogin(cid)

local loss = getConfigValue('deathLostPercent')

if(loss ~= nil) then

doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)

end

local accountManager = getPlayerAccountManager(cid)

if(accountManager == MANAGER_NONE) then

local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage

if(lastLogin > 0) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)

str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."

else

str = str .. " Please choose your outfit."

doPlayerSendOutfitWindow(cid)

end

doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)

elseif(accountManager == MANAGER_NAMELOCK) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")

elseif(accountManager == MANAGER_ACCOUNT) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")

else

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")

end

if(not isPlayerGhost(cid)) then

doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)

end

registerCreatureEvent(cid, "Mail")

registerCreatureEvent(cid, "GuildMotd")

doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))

registerCreatureEvent(cid, "kill")

registerCreatureEvent(cid, "onPrepareDeath")

registerCreatureEvent(cid, "PlayerLogout")

registerCreatureEvent(cid, "onPrepareDeath")

registerCreatureEvent(cid, "deathBroadcast")

registerCreatureEvent(cid, "DeathBroadcast")

registerCreatureEvent(cid, "SkullCheck")

registerCreatureEvent(cid, "ReportBug")

if (InitArenaScript ~= 0) then

InitArenaScript = 1

-- make arena rooms free

for i = 42300, 42309 do

setGlobalStorageValue(i, 0)

setGlobalStorageValue(i+100, 0)

end

end

-- if he did not make full arena 1 he must start from zero

if getPlayerStorageValue(cid, 42309) < 1 then

for i = 42300, 42309 do

setPlayerStorageValue(cid, i, 0)

end

end

-- if he did not make full arena 2 he must start from zero

if getPlayerStorageValue(cid, 42319) < 1 then

for i = 42310, 42319 do

setPlayerStorageValue(cid, i, 0)

end

end

-- if he did not make full arena 3 he must start from zero

if getPlayerStorageValue(cid, 42329) < 1 then

for i = 42320, 42329 do

setPlayerStorageValue(cid, i, 0)

end

end

if getPlayerStorageValue(cid, 42355) == -1 then

setPlayerStorageValue(cid, 42355, 0) -- did not arena level

end

setPlayerStorageValue(cid, 42350, 0) -- time to kick 0

setPlayerStorageValue(cid, 42352, 0) -- is not in arena

return true

end

alguma coisa no deathBroadcast

local config = {

affected = 10, -- how many players (deathAssits) from table deathList should this script be executed for?

killStorageValue = 3943,

deathStorageValue = 3944,

-- commands for the texts (those inside of ||, example: |KILLS| to show skills): KILLS, KILLERNAME, TARGETNAME

rewardItem = {

use = true,

itemid = 2296,

minLevel = false, -- false if you don't want any level req

minLevelDiff = false, -- false if you don't want any level diff req (negative numbers allowed).

},

killMessage = {

use = true,

text = "You owned |TARGETNAME|! You have now |KILLERKILLS| kills!",

messageClass = MESSAGE_STATUS_CONSOLE_BLUE

},

broadcastMessage = {

use = true,

minLevel = false, -- false if you don't want any level req

minLevelDiff = false, -- false if you don't want any level diff req (negative numbers allowed).

text = "|KILLERNAME| [|KILLERLEVEL|] MATOU |TARGETNAME| [|TARGETLEVEL|]!",

messageClass = MESSAGE_STATUS_WARNING

},

killerAnimation = {

use = true,

text = "Frag!", -- Only 9 letters! No "commands" here.

color = 144

},

targetAnimation = {

use = true,

text = "Owned!", -- Only 9 letters! No "commands" here.

color = 180

}

}

function onDeath(cid, corpse, deathList)

for i = 1, math.min(config.affected, getConfigInfo('deathAssistCount')) do

local killer = deathList

if(isPlayer(killer) == TRUE) then

local targetKills = math.max(0, getPlayerStorageValue(cid, config.killStorageValue)) + 1

local targetDeaths = math.max(0, getPlayerStorageValue(cid, config.deathStorageValue)) + 1

local killerKills = math.max(0, getPlayerStorageValue(killer, config.killStorageValue)) + 1

local killerDeaths = math.max(0, getPlayerStorageValue(killer, config.deathStorageValue)) + 1

setPlayerStorageValue(killer, config.killStorageValue, targetKills)

setPlayerStorageValue(cid, config.deathStorageValue, targetDeaths)

local killerLevel = getPlayerLevel(killer)

local targetLevel = getPlayerLevel(cid)

local levelDiff = targetLevel - killerLevel

local values = {

["KILLERKILLS"] = killerKills,

["KILLERDEATHS"] = killerDeaths,

["KILLERNAME"] = getCreatureName(killer),

["KILLERLEVEL"] = killerLevel,

["TARGETKILLS"] = targetKills,

["TARGETDEATHS"] = targetDeaths,

["TARGETNAME"] = getCreatureName(cid),

["TARGETLEVEL"] = targetLevel

}

function formateString(str)

return(str:gsub("|([A-Z]+)|", (function(a) return values[a] end)))

end

if(config.rewardItem.use and (not config.rewardItem.minLevel or targetLevel >= config.rewardItem.minLevel) and (not config.rewardItem.minLevelDiff or levelDiff >= config.rewardItem.minLevelDiff)) then

local uid = doPlayerAddItem(killer, config.rewardItem.itemid, 1)

end

if(config.killMessage.use) then

doPlayerSendTextMessage(killer, config.killMessage.messageClass, formateString(config.killMessage.text))

end

if(config.broadcastMessage.use and (not config.broadcastMessage.minLevel or getPlayerLevel(cid) >= config.broadcastMessage.minLevel) and (not config.broadcastMessage.minLevelDiff or levelDiff >= config.broadcastMessage.minLevelDiff)) then

broadcastMessage(formateString(config.broadcastMessage.text), config.broadcastMessage.messageClass)

end

if(config.killerAnimation.use) then

doSendAnimatedText(getCreaturePosition(killer), config.killerAnimation.text, config.killerAnimation.color)

end

if(config.targetAnimation.use) then

doSendAnimatedText(getCreaturePosition(cid), config.targetAnimation.text, config.targetAnimation.color)

end

end

end

return true

end

Editado por MonsterOt (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

tente esse aqui::

Login.lua

local config = {

	loginMessage = getConfigValue('loginMessage')

}


function onLogin(cid)

	local loss = getConfigValue('deathLostPercent')

	if(loss ~= nil) then

		doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)

	end


	local accountManager = getPlayerAccountManager(cid)

	if(accountManager == MANAGER_NONE) then

		local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage

		if(lastLogin > 0) then

			doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)

			str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."

		else

			str = str .. " Please choose your outfit."

			doPlayerSendOutfitWindow(cid)

		end


		doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)

	elseif(accountManager == MANAGER_NAMELOCK) then

		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")

	elseif(accountManager == MANAGER_ACCOUNT) then

		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")

	else

		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")

	end


	if(not isPlayerGhost(cid)) then

		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)

	end


	registerCreatureEvent(cid, "Mail")

	registerCreatureEvent(cid, "GuildMotd")


registerCreatureEvent(cid, "kill")

registerCreatureEvent(cid, "onPrepareDeath")

registerCreatureEvent(cid, "PlayerLogout")

registerCreatureEvent(cid, "onPrepareDeath")

registerCreatureEvent(cid, "deathBroadcast")

registerCreatureEvent(cid, "DeathBroadcast")

registerCreatureEvent(cid, "SkullCheck")

registerCreatureEvent(cid, "ReportBug")

registerCreatureEvent(cid, "PlayerKill")

	if (InitArenaScript ~= 0) then

	InitArenaScript = 1

	-- make arena rooms free

		for i = 42300, 42309 do

			setGlobalStorageValue(i, 0)

			setGlobalStorageValue(i+100, 0)

		end

	end

	-- if he did not make full arena 1 he must start from zero

	if getPlayerStorageValue(cid, 42309) < 1 then

		for i = 42300, 42309 do

			setPlayerStorageValue(cid, i, 0)

		end

	end


	-- if he did not make full arena 2 he must start from zero

	if getPlayerStorageValue(cid, 42319) < 1 then

		for i = 42310, 42319 do

			setPlayerStorageValue(cid, i, 0)

		end

	end


	-- if he did not make full arena 3 he must start from zero

	if getPlayerStorageValue(cid, 42329) < 1 then

		for i = 42320, 42329 do

			setPlayerStorageValue(cid, i, 0)

		end

	end

	if getPlayerStorageValue(cid, 42355) == -1 then

		setPlayerStorageValue(cid, 42355, 0) -- did not arena level

	end

	setPlayerStorageValue(cid, 42350, 0) -- time to kick 0

	setPlayerStorageValue(cid, 42352, 0) -- is not in arena  

return true

end

Link para o post
Compartilhar em outros sites

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo