Talkactions [?atwe Konfigurowalny] Gracz Teleport do konfigurowalnych miast / dom do got?wki w /exhaustion

Status
Zamknięty.

Gangstabanga

Advanced User
Zarejestrowany
Dołączył
Sierpień 26, 2009
Posty
279
Liczba reakcji
13
Wiek
36
Skrypt bY chavoz

Skrypt ten jest dla graczy, z polecenia! Tp lub inny, gracz mo?e teleportowa? si? do konfigurowalnych miejsc lub jego domu ... R?wnie? u mo?na skonfigurowa? potrzebne pieni?dze i czas wyczerpania (w sekundach)!
Czy naprawd? ?atwo konfigurowalny ? zobacz sam

Dodaj do talkactions.xml:
Kod:
<talkaction words="!tp" event="script" value="tpAllCitys.lua"/>

Nast?pnie utw?rz plik LUA nazwie tpAllCitys.lua, umie?ci? to w ?rodku:

Kod:
-- script made by chavoz --
----- otLand.net -----
 
 
local cash = 10000 -- u can modify the prize (actual 1cc)
local cdtele = 900 -- the seconds of cooldown (900=15min)
local etele = 9499 -- isn't necessary to change
 
local config = {
premium = false, -- if is needed be premium to use this teleport (true or false)
battle = true -- if is needed be without battle to use (true or false)
}
 
local places = {
[1] = {name = "Enigma", id = 1},
[2] = {name = "Infernium", id = 2},
[3] = {name = "Desert", id = 3},
[4] = {name = "Ice", id = 4},
[5] = {name = "Thais", id = 5},
}
 
function onSay(cid, words, param)
 
 
	if exhaustion.get(cid, etele) and exhaustion.get(cid, etele) > 0 then
	tempo = (exhaustion.get(cid, etele)) / 60
	min = math.floor(tempo)
doPlayerSendTextMessage(cid,27,"You have to wait more "..min.." minutes.")
	return true
	end
 
	if config.battle and getCreatureCondition(cid, CONDITION_INFIGHT) then
doPlayerSendTextMessage(cid,27,"You can't teleport with fight.")
	return true
	end
 
	if (param == '') then
		local str = ""
		str = str .. "Existent places: \n\nHouse\n"
			for a = 1, #places do
				str = str..""..places[a].name.."\n"
			end
		doShowTextDialog(cid, 2333, str)
	return true
	end
 
	local lastppos = getThingPos(cid)
	local telepos = {}
	local myplace = ""
	local townid = 0
 
	if string.lower(param) == "house" then
 
		if not getHouseByPlayerGUID(getPlayerGUID(cid)) then
			doPlayerSendTextMessage(cid,27, "You don't own a house.")
	doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
		return true
		end
 
		telepos = getHouseEntry(getHouseByPlayerGUID(getPlayerGUID(cid)))
		myplace = "house"
           effect = CONST_ME_TELEPORT
 
	else
effect = CONST_ME_TELEPORT
 
		for x = 1, #places do
			if string.find(string.lower(places[x].name), string.lower(param)) then
				townid = places[x].id
				myplace = places[x].name
			end
		end
 
		if myplace == "" then
doPlayerSendTextMessage(cid,27,"Sorry, this place don't exist.")
	doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
		return true
		end
 
	end
 
	if myplace ~= "" and townid > 0 then
		telepos = getTownTemplePosition(townid)
	end
 
if doPlayerRemoveMoney(cid, cash) == TRUE then
 
	doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
 
	doTeleportThing(cid, telepos, false)
 
	local pos2 = getClosestFreeTile(cid, getPosByDir(getThingPos(cid), SOUTH))
 
	doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
 
	doCreatureSay(cid, "Teleport to "..myplace.."!", TALKTYPE_MONSTER)
doPlayerSendTextMessage(cid,27,"You have teleported to "..myplace.." for "..cash.." gps!")
doPlayerSendTextMessage(cid,27,"To use again wait "..cdtele.." seconds.")
 
	doCreatureSetLookDir(cid, SOUTH)
 
	exhaustion.set(cid, etele, cdtele)
 
else
doPlayerSendTextMessage(cid,27,"You haven't enough money ("..cash.." gps)!")
	doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
end
 
return true
end

C??, aby edytowa? w miejscach mo?na zobaczy? miasta swojego serwera w Remeres Map Editor, naci?nij kombinacj? klawiszy Ctrl + T i poka?e wszystkie miasta swojego serwera i ID miasta ...

Aby doda? 1 + w miejsce mo?e doda? to

Kod:
[6] = {name = "Your town name", id = TOWN ID},


Link do orginalnego tematu :http://otland.net/f81/easy-configurable-player-teleport-configurable-cities-house-cash-w-exhaustio-182753/
 
Odp: [?atwe Konfigurowalny] Gracz Teleport do konfigurowalnych miast / dom do got?wki w /exhaustion

czas odwiedzi? podstaw?wk? i nauczy? si? j. angielskiego, bo na translatorze daleko nie zajedziesz jeszcze co najmniej przez 15 dobrych lat
 
Status
Zamknięty.
Back
Do góry