avertuss 48 Posted August 3, 2017 Share Posted August 3, 2017 Hi. I have quest(tp to friend) quest teleport_to_player begin state start begin when login begin cmdchat("teleport "..q.getcurrentquestindex()) end when button or info begin if get_time() < pc.getqf("duration_tp") then return end sname = getinput("getinput") if sname == "" then return end local u_vid = find_pc_by_name(sname) local m_vid = pc.get_vid() if u_vid == 0 then return end local m_name = pc.name local old = pc.select(u_vid) local x,y = pc.get_x()*100,pc.get_y()*100 local is_blocked = pc.getf("teleport_to_player_block", m_name) pc.select(old) if u_vid == m_vid then return end if is_blocked == 1 then syschat("Player: "..sname.." blocked tp.") else local ok_sign = confirm(u_vid, string.format("Player "..m_name.." wants tp.", pc.name), 30) if ok_sign == CONFIRM_OK then pc.setqf("duration_tp",get_time()+1*5*1) pc.warp(x,y) end end end end end but i don't know how can i make that players can tp only to players from the same guild. Any ideas? Link to comment Share on other sites More sharing options...
Tasho 243 Posted August 4, 2017 Share Posted August 4, 2017 Try that. local x, y, targetGuild = pc.get_x() * 100, pc.get_y() * 100, pc.get_guild() if is_blocked == 1 then syschat("Player: "..sname.." blocked tp.") elseif pc.get_guild() == 0 then syschat("You have to be in a guild.") elseif targetGuild == 0 then syschat("Player: "..sname.." is not in a guild.") elseif targetGuild ~= pc.get_guild() then syschat("Player: "..sname.." is not member of same guild as you.") else [......................] end 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now