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

tp - zmiana town ID

katamaran

Banned User
Joined
May 12, 2013
Messages
35
Reaction score
0
Jak zrobic, aby po wejsciu w TP zmienialo sie town ID ? (tzn , że jak umrę to będę się respić w temple tego nowego miasta)
 
Masz nawet gotowy skrypt w tfsie o ile pamiętam. Sprawdź sobie dla jakiego id działa i wtedy tylko aid jakieśtam+idmiasta i nic nie musisz więcej robić. Tylko po co zakładać temat skoro można było to sprawdzić? A nawet jakby kodu nie było to w luascript.cpp byś znalazł odpowiednią funkcję i jej składnie
 
w movements/scripts/ masz taki magiczny skrypt citizen.lua(oczywiscie jesli go nie skasowales z tego folderu no i z movements.xml)
dziala on na tej zasadzie ze ustawiasz zwykly tp na mapie(o id 1387), ustawiasz mu action id ktory wynosi 30020 + town_id, czyli np jesli thais masz town_id = 5 to ustawiasz action id dla tego tp 30025 i gracz po wejsciu w niego bedzie mial juz nowe miejsce zamieszkania, itd...
 
mam taki plik lua
Lua:
function onStepIn(cid, item, position, fromPosition)
	if(item.actionid > 30020 and item.actionid < 30100) then
		local townId = (item.actionid - 30020)
		doPlayerSetTown(cid, townId)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are the newest resident of " .. getTownName(townId) .. ".")
	end

	return true
end

Czyli wystarczy ze teraz ustawie byle gdzie teleport co bedzie mial aid 30022 i kazdy co wejdzie w ten tp bedzie obywatelem miasta o id 2 ?
 
function onStepIn(cid, item, frompos, item2, topos)

playerpos = getPlayerPosition(cid)
novapos = {x=438, y=501, z=8}

if item.uid == 1003 then

doPlayerSetTown(cid,3)
getThingfromPos(playerpos)
doSendMagicEffect(playerpos,2)
doPlayerSendTextMessage(cid,18,"Jestes obywatelem miasta: nazwamiasta")
doTeleportThing(cid,novapos)
doSendMagicEffect(novapos,10)
end
end


Prosciej sie chyba nie da...
 
Back
Top