Wgralem sobie Regroup System z Materii i gdy wychodze leaderem z regroup roomu i daje loga to wyskakuje:
Wie ktos o co chodzi :3?
Code:
21/12/2014 13:46:17] mysql_real_query(): INSERT INTO `player_storage` (`player_id`, `key`, `value`) VALUES (12, '0', '0'),(12, '30001', '1'),(12, '31001', '1'),(12, '5252', '1419165977'),(12, 'regroupRoom', '0') - MYSQL ERROR: Duplicate entry '12-0' for key 'player_id_2' (1062)
[21/12/2014 13:46:17] mysql_real_query(): INSERT INTO `player_storage` (`player_id`, `key`, `value`) VALUES (12, '0', '0'),(12, '30001', '1'),(12, '31001', '1'),(12, '5252', '1419165977'),(12, 'regroupRoom', '0') - MYSQL ERROR: Duplicate entry '12-0' for key 'player_id_2' (1062)
[21/12/2014 13:46:17] mysql_real_query(): INSERT INTO `player_storage` (`player_id`, `key`, `value`) VALUES (12, '0', '0'),(12, '30001', '1'),(12, '31001', '1'),(12, '5252', '1419165977'),(12, 'regroupRoom', '0') - MYSQL ERROR: Duplicate entry '12-0' for key 'player_id_2' (1062)
[21/12/2014 13:46:17] Error while saving player: Kahras Tester.
Code:
<?xml version='1.0' encoding='UTF-8'?>
<mod name='Regrouping Room' version='1.0' enabled='yes'>
<config name='regroup_config'>
<![CDATA[
regroupCfg = {
rooms = {
[1] = {
teleportPos = {x = 470, y = 925, z = 7},
isFree = 0
},
[2] = {
teleportPos = {x = 470, y = 941, z = 7},
isFree = 0
},
[3] = {
teleportPos = {x = 470, y = 957, z = 7},
isFree = 0
},
[4] = {
teleportPos = {x = 470, y = 973, z = 7},
isFree = 0
},
[5] = {
teleportPos = {x = 470, y = 989, z = 7},
isFree = 0
},
[6] = {
teleportPos = {x = 500, y = 989, z = 7},
isFree = 0
},
[7] = {
teleportPos = {x = 500, y = 973, z = 7},
isFree = 0
},
[8] = {
teleportPos = {x = 500, y = 957, z = 7},
isFree = 0
},
[9] = {
teleportPos = {x = 500, y = 941, z = 7},
isFree = 0
},
[10] = {
teleportPos = {x = 500, y = 925, z = 7},
isFree = 0
},
},
minLevel = 1,
backPos = {x=1000, y=1000, z=7},
minOnline = 2,
timeExhaust = 10, -- sekundy
exhaustStorage = 5252
}
]]>
</config>
<!-- Wejscie -->
<movement type='StepIn' actionid='5000' event='script'>
<![CDATA[
domodlib('regroup_config')
function getGuildMembersOnline(guid)
local mem = {}
for _, cid in ipairs(getPlayersOnline()) do
if getPlayerGuildId(cid) == guid then
table.insert(mem, cid)
end
end
return mem
end
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
if not isPlayer(cid) then
return false
elseif exhaustion.get(cid, regroupCfg.exhaustStorage) then
return doPlayerSendCancel(cid, 'You must wait '..exhaustion.get(cid, regroupCfg.exhaustStorage)..' seconds to be teleport again.'), doTeleportThing(cid, fromPosition)
end
exhaustion.set(cid, regroupCfg.exhaustStorage, regroupCfg.timeExhaust)
if getPlayerGuildId(cid) < 1 then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Sorry ale nie posiadasz gildii!'), doTeleportThing(cid, fromPosition)
end
local free = 0
for k, v in pairs(regroupCfg.rooms) do
if v.isFree == 0 then
free = k
end
if v.isFree == getPlayerGuildId(cid) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You have been teleported to your guild.')
doTeleportThing(cid, v.teleportPos)
doCreatureSetStorage(cid, 'regroupRoom', k)
return true
end
end
if getPlayerGuildLevel(cid) >= GUILDLEVEL_LEADER then
if regroupCfg.minLevel >= getPlayerLevel(cid) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You don\'t have enough level to go thourgh.'), doTeleportThing(cid, fromPosition)
elseif regroupCfg.minOnline > #getGuildMembersOnline(getPlayerGuildId(cid)) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'In your guild there aren\'t '..regroupCfg.minOnline..' online members.'), doTeleportThing(cid, fromPosition)
end
if free ~= 0 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You have been teleported to free room.')
doCreatureSetStorage(cid, 'regroupRoom', free)
doTeleportThing(cid, regroupCfg.rooms[free].teleportPos)
regroupCfg.rooms[free].isFree = getPlayerGuildId(cid)
return true
end
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'There isn\'t free room.'), doTeleportThing(cid, fromPosition)
else
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Your guild isn\'t in any room.'), doTeleportThing(cid, fromPosition)
end
return true
end
]]>
</movement>
<!-- Wyjscie -->
<movement type='StepIn' actionid='7000' event='script'>
<![CDATA[
domodlib('regroup_config')
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
if not isPlayer(cid) then
return false
elseif getPlayerGuildId(cid) < 1 then
return doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
end
if getPlayerGuildLevel(cid) >= GUILDLEVEL_LEADER then
local p, k = regroupCfg.backPos, getCreatureStorage(cid, 'regroupRoom')
regroupCfg.rooms[k].isFree = 0
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You leave from room with your guild.')
for _, pid in ipairs(getPlayersOnline()) do
if getCreatureStorage(pid, 'regroupRoom') == k then
doCreatureSetStorage(pid, 'regroupRoom', 0)
doTeleportThing(pid, {x=p.x+math.random(-1,1),y=p.y+math.random(-1,1), z=p.z})
end
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You have been teleported to temple.')
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doCreatureSetStorage(cid, 'regroupRoom', 0)
end
return true
end
]]>
</movement>
<globalevent name='Regroup_start' type='startup' event='script'>
<![CDATA[
domodlib('regroup_config')
function onStartup()
for k, v in pairs(regroupCfg.rooms) do
v.isFree = 0
end
return true
end
]]>
</globalevent>
</mod>
Wie ktos o co chodzi :3?