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

[LUA]Waypoints (tfs0.3beta2 {8.4})

Marcinek123

Badboy
Joined
Jan 21, 2008
Messages
49
Reaction score
0
Location
Poland
WAYPOINTS 0.3beta2 (tfs)

in talkactions.xml
Code:
<talkaction words="!wp" script="Waypoints.lua"/>


waypoint.lua
Code:
-- made by Chojrak
-- edit by Czaruś (Marcinek123)under TFSbeta2
function onSay(cid, words, param)
	[COLOR="Red"]local name1place = {x = 205, y = 373, z = 7}
	local name2place = {x = 207, y = 375, z = 7}
	local name3place = {x = 209, y = 379, z = 7}[/COLOR]
	local tmp = getPlayerPosition(cid)
	if (tmp.x == 207 and tmp.y == 373 and tmp.z == 7)  then --/position when player must stand in order to use the portal...  
		if (param == 'nemeInWorldBehind !wp ') then
			doTeleportThing(cid, name2place, FALSE)
			doSendAnimatedText(getPlayerPosition(cid),'Bzzzzz', TEXTCOLOR_YELLOW)
			doSendMagicEffect(tmp, 31)
			doSendMagicEffect(getPlayerPosition(cid), 10)
		elseif (param == ''nemeInWorldBehind !wp ') then
			doTeleportThing(cid, name3place , FALSE)
			doSendAnimatedText(getPlayerPosition(cid),'Bzzzzz', TEXTCOLOR_YELLOW)
			doSendMagicEffect(tmp, 31)
			doSendMagicEffect(getPlayerPosition(cid), 10)
		else
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, Not possible.")
	end
	else
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, Not possible.")
	end
		return TRUE
end

Oh I forgotten... if you wanna tp you must say '!wp p2'
On red is my 'x,y,z' change this under your map ;]
 
Last edited:
Try this...

Code:
function onSay(cid, words, param)
	local town = {x =444, y =429, z =7}
	local city = {x =345, y =500, z =6}
	local village = {x =419, y =421, z =7}
	if (getPlayerPosition(cid) == town) then
		if (param == "city") then

			doTeleportThing(cid, city)

		elseif (param == "village") then

			doTeleportThing(cid, village)

		else

		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Not possible.")

		end
	end
	return TRUE
end
 
Are there any errors that you're getting? It'd be a little easier to track down faulties with the error report. ;)
 
heh i no have error;/ it... doesn't simply work ...;/

when i say '!goto "city' (in talkaction "!goto" is a command) and... see anything... nothing in chat... nothin in console... god dmn it;/
 
And the coordinates you're using are correct according to your map? (The coordinates works, and there are groundtiles there) Since it won't give you an error if the tile doesn't exist.
 
But its working diffrent than your script ;p

in functions.lua add

PHP:
function comparePos(pos1, pos2)
	return (pos1.x == pos2.x and pos1.y == pos2.y and pos1.z == pos2.z)
end

and use this script:

PHP:
local standPos = {x=843,y=697,z=7}
local newPos = {x=2230,y=2321,z=6}
 
function onSay(cid, param)
    if comparePos(getPlayerPosition(cid), standPos) then
        doSendMagicEffect(getPlayerPosition(cid), 2)
        doTeleportThing(cid, newPos)
        doSendMagicEffect(newPos, 10)
    end
    return 1
end

PHP:
<talkaction words="city" script="city.lua" />
 
Perhaps it works but at the substantial amount of teleports it is already a problem. and I wants will still add activations of portals (storages) it is already an outer 'space' ;/

thx Simonel for help (rep+) and darkhaps (rep+)
 
Last edited:
Try this.
Code:
local marks =
{
    ['city'] = {x = 345, y = 500, z = 6},
    ['village'] = {x = 419, y = 421, z = 7}
}

function onSay(cid, words, param)
    local tmp = getCreaturePosition(cid)
    if(tmp.x == 95 and tmp.y == 117 and tmp.z == 7) then
        local mark = marks[param]
        if(mark ~= nil) then
            doTeleportThing(cid, mark, FALSE)
        end
    else
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Not possible.")
    end
    return TRUE
end

And write in game, !goto city, !goto village.
 
Last edited:
Back
Top