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

Talkaction & Action - save

Fresh

Quack!
Joined
Oct 21, 2009
Messages
1,855
Solutions
18
Reaction score
671
Hello guys! (im not rasist nerso123 <_<)
I have LAST request for you guys!

I have item id: 5355
If you use it and you dont have saved your (x;y;z) it says: "First go and save your position using !tpsave command".

If you go on position what you want and say "!tpsave" you saved your position (where you stay).

If you are in depot and want back you click on item (5355) and teleport you to this position where you save before.

You can't have PZ/fighting when you using 5355 item.

It`s possible to do ? ^_^
I know you know me xP
 
@Up
I wrote: "I`m from Poland, racist" i mean I from Poland and im no racist i wrote it because 50% of ppl doesn't like polish guys.

@Cybershot
Sorry :$


Bump, after night ^_^
 
Is this what you want?
Talkaction:
LUA:
<talkaction hide="yes" words="!tpsave" event="script" value="tptosave.lua"/>

LUA:
function onSay(cid, words, param, channel)
	pos = getCreaturePosition(cid)
		setPlayerStorageValue(cid,4345,getCreaturePosition(cid).x)
		setPlayerStorageValue(cid,4346,getCreaturePosition(cid).y)
		setPlayerStorageValue(cid,4347,getCreaturePosition(cid).z)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "I have saved your position")
return true
end
Action:
LUA:
<action itemid="xxx" event="script" value="savetp.lua"/>

LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE then
		doPlayerSendChannelMessage(cid,"You can only use this item when your not in a fight!")
	elseif getCreatureSkullType(cid) >= 3 then
		doPlayerSendChannelMessage(cid,"You can only use this item without skull.")
        else
		if getPlayerStorageValue(cid,4345) > 100 and getPlayerStorageValue(cid,4346) > 100 then
			local cpos = getCreaturePosition(cid)
			local pos = {x = getPlayerStorageValue(cid,4345),y = getPlayerStorageValue(cid,4346),z = getPlayerStorageValue(cid,4347)}
			doSendMagicEffect(cpos, 2)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You teleported you your last saved position.")
			doTeleportThing(cid, pos,true)
			doSendMagicEffect(pos, 10)			
		else
			doPlayerSendChannelMessage(cid, "First go and save your position using !tpsave command")
		end
	end
return true
end
 
Last edited:
@Up
You're god!
Repp++++++
Bro!


@Edit
But can you add function where if player have skull, he cant use this ?
 
Changed my prev post.

Now you can save a pos whith skull but you can't use the item.
if a skull try to use it he/she get a message: You can only use this item without skull.

didn't test it now whith skull but i think it works. post error if you get one.
 
Change talkaction to:
LUA:
function onSay(cid, words, param, channel)
	pos = getCreaturePosition(cid)
		if getTilePzInfo(pos) == true then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can't save your position when you are in protection zone or in a house.")
		else
			setPlayerStorageValue(cid,4345,getCreaturePosition(cid).x)
			setPlayerStorageValue(cid,4346,getCreaturePosition(cid).y)
			setPlayerStorageValue(cid,4347,getCreaturePosition(cid).z)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "I have saved your position")
		end
return true
end
Now you can't save your position an a protection zone or a house.
I'm not sure about house but it worked for me.
 
Back
Top