There is that GM cmd .recal, it could be changed to .leavepvp by blocking part where u can .recal others, so it works only on yourself.
But somebody smart gota do it :D
Printable View
There is that GM cmd .recal, it could be changed to .leavepvp by blocking part where u can .recal others, so it works only on yourself.
But somebody smart gota do it :D
Code:function pvp_enter_cmd(player,args,type)
if args == "enter" and not player:isInCombat() then
player:TeleportTo( 0 , -13228.1, 227.833, 32.8926 , 1.06 ,true ,true )
end
return true
end
register_lua_script_command(".pvp","pvp_enter_cmd")
Code:function pvp_enter_cmd(player,args,type)
if not player:isInCombat() then
player:TeleportTo( 0 , -13228.1, 227.833, 32.8926 , 1.06 ,true ,true )
end
return true
end
register_lua_script_command(".enterpvp","pvp_enter_cmd")
function pvp_leave_cmd(player,args,type)
if not player:isInCombat() then
player:TeleportTo( 0 , -13228.1, 227.833, 32.8926 , 1.06 ,true ,true )
end
return true
end
register_lua_script_command(".leavepvp","pvp_leave_cmd")
Dristol is that Code Working or what ?
Thats using lua scripting.
I think most of the mangos cores I use wont be able to us ethat, but nice work.
If i want to use that code, how do i do ? iam not very good at this yet
I added this code in my Masterscript.lua and i can use .enterpvp but .leavepvp dosent work , .leavepvp has the same function as .enterpvp
As a temporary fix, just change the coordinates in .leavepvp command. If you had looked at the script BEFORE you added it to your server, you would have noticed that both the .enterpvp and the .leavepvp command are identical.
yee i now, so how can we do so the .leavepvp command takes us to the same location where we first used .enterpvp?
pvp_cmd.lua
sql to create tableCode:function round(num, idp)
local mult = 10^(idp or 0)
return math.floor(num * mult + 0.5) / mult
end
function pvp_enter_cmd(player,args,type)
if not player:isInCombat() and not player:isInFlight() then
local myx = player:getPlayerX();
local myy = player:getPlayerY();
local myz = player:getPlayerZ();
local mymap = player:getPlayerMapID();
local mypvpid = tonumber(player:GetGUIDLow());
queryString = "SELECT `time_enter` FROM `pvp_cmd_data` WHERE `playerid`="..mypvpid;
local query = sDatabase:Query(queryString)
local pvptimenow = os.time();
if query ~= nil and query:GetRowCount() > 0 then
local gotpvpdata = query:Fetch()
local cooldown = gotpvpdata[0]:GetInt32()
--local mymap = gotpvpdata[1]:GetString()
if (pvptimenow - cooldown) >= 1800 then
sDatabase:Execute("DELETE FROM `pvp_cmd_data` WHERE `playerid`="..mypvpid.."");
sDatabase:Execute("INSERT INTO `pvp_cmd_data` VALUES("..pvptimenow..", "..mypvpid..", "..mymap..", "..pvptimenow..", 1, "..myx..", "..myy..", "..myz..")")
player:TeleportTo( 0 , -13228.1, 227.833, 32.8926 , 1.06 ,true ,true )
else
local pvpwaittime = ((1800 - (pvptimenow - cooldown)) / 60)
local newtime = round(pvpwaittime, 1)
player:SendSysMessage("You can not do that yet you must wait "..newtime.." minutes.")
end
else
--sDatabase:Execute("INSERT INTO `pvp_cmd_data` VALUES("..pvptimenow..", "..mypvpid..", "..mymap..","..pvptimenow..",1)")
sDatabase:Execute("INSERT INTO `pvp_cmd_data` VALUES("..pvptimenow..", "..mypvpid..", "..mymap..", "..pvptimenow..", 1, "..myx..", "..myy..", "..myz..")")
player:TeleportTo( 0 , -13228.1, 227.833, 32.8926 , 1.06 ,true ,true )
end
end
return true
end
register_lua_script_command(".pvpenter","pvp_enter_cmd")
function pvp_leave_cmd(player,args,type)
if not player:isInCombat() and not player:isInFlight() then
local mypvpid = tonumber(player:GetGUIDLow());
queryString = "SELECT `mymap` , `time_leave` , `in_arena` , `myx` , `myy` , `myz` FROM `pvp_cmd_data` WHERE `playerid`="..mypvpid;
local query = sDatabase:Query(queryString)
local pvptimenow = os.time();
if query ~= nil and query:GetRowCount() > 0 then
local gotpvpdata = query:Fetch()
local gomapid = gotpvpdata[0]:GetInt32()
local cooldown = gotpvpdata[1]:GetInt32()
local canleave = gotpvpdata[2]:GetInt32()
local gox = gotpvpdata[3]:GetInt32()
local goy = gotpvpdata[4]:GetInt32()
local goz = gotpvpdata[5]:GetInt32()
if canleave == 1 then
if (pvptimenow - cooldown) >= 60 then
--player:TeleportTo( 0 , -14406.59, 419.35, 22.39 , 1.06 ,true ,true )
player:TeleportTo( gomapid , gox , goy , goz , 1.06 ,true ,true )
sDatabase:Execute("UPDATE `pvp_cmd_data` SET `in_arena`='0' WHERE `playerid`='"..mypvpid.."'")
else
local pvpwaittime = ((60 - (pvptimenow - cooldown)) / 60)
local newtime = round(pvpwaittime, 1)
player:SendSysMessage("You only just got here, you must wait "..newtime.." minutes.")
end
else
player:SendSysMessage("You must be in the arena! Type .pvpenter")
end
end
end
return true
end
register_lua_script_command(".pvpleave","pvp_leave_cmd")
Big credit to biglad for this script!Code:CREATE TABLE `pvp_cmd_data` (
`time_enter` varchar(255) default NULL,
`playerid` int(11) default NULL,
`mymap` varchar(255) default NULL,
`time_leave` varchar(255) default NULL,
`in_arena` int(11) default NULL,
`myx` varchar(255) default NULL,
`myy` varchar(255) default NULL,
`myz` varchar(255) default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='InnoDB free: 22528 kB; InnoDB free: 22528 kB; InnoDB free: 2';