Itt hol? Nem találom..
mysql = exports.mysql
-- cells Pozíció: 1754.6796875, -1592.8974609375, 13.532894134521 Rotáció: 172.52368164062 Dimenzió: 0 Interior: 0
cells =
{
createColSphere( 222.9794921875, 114.3486328125, 999.015625, 10 )
}
for k, v in pairs( cells ) do
setElementInterior( v, 10 )
setElementDimension( v, 1 )
end
function isInArrestColshape( thePlayer )
for k, v in pairs( cells ) do
if isElementWithinColShape( thePlayer, v ) and getElementDimension( thePlayer ) == getElementDimension( v ) then
return k
end
end
return false
end
function destroyJailTimer ( ) -- 0001290: PD /release bug
local theMagicTimer = getElementData(source, \"pd.jailtimer\") -- 0001290: PD /release bug
if (isTimer(theMagicTimer)) then
killTimer(theMagicTimer)
exports[\'anticheat-system\']:changeProtectedElementDataEx(source, \"pd.jailserved\", 0, false)
exports[\'anticheat-system\']:changeProtectedElementDataEx(source, \"pd.jailtime\", 0, false)
exports[\'anticheat-system\']:changeProtectedElementDataEx(source, \"pd.jailtimer\")
exports[\'anticheat-system\']:changeProtectedElementDataEx(source, \"pd.jailstation\")
end
end
addEventHandler ( \"onPlayerQuit\", getRootElement(), destroyJailTimer )
function SendMessageToTeam(theTeam, uzenet, r, g, b)
if not r then r = 255 end
if not g then g = 255 end
if not b then b = 255 end
local CsapatID = getTeamFromName( tostring(theTeam) )
if ( CsapatID ) then
local teamPlayers = getPlayersInTeam( CsapatID )
for k, v in ipairs(teamPlayers) do
outputChatBox(uzenet, v, r, g, b)
end
return true
else
return false
end
end
-- /arrest
function arrestPlayer(thePlayer, commandName, targetPlayerNick, fine, jailtime, ...)
local logged = getElementData(thePlayer, \"loggedin\")
if (logged==1) then
local theTeam = getPlayerTeam(thePlayer)
local factionType = getElementData(theTeam, \"type\")
local teamID = getElementData(theTeam, \"id\")
if (jailtime) then
jailtime = tonumber(jailtime)
end
local playerCol = isInArrestColshape(thePlayer)
if playerCol then
if not (targetPlayerNick) or not (fine) or not (jailtime) or not (...) or (jailtime<1) or (jailtime>9999999) then
outputChatBox(\"HASZNÁLAT: /arrest [Játékos Névrészlet / ID] [bírság] [idő (Perc 1->9999999)] [Elkövetett bűn]\", thePlayer, 255, 194, 14)
else
local targetPlayer, targetPlayerNick = exports.global:findPlayerByPartialNick(thePlayer, targetPlayerNick)
if targetPlayer then
local targetCol = isInArrestColshape(targetPlayer)
if not targetCol then
outputChatBox(\"(( A rab nincs a letartóztatási helyen! ))\", thePlayer, 255, 0, 0)
elseif targetCol ~= playerCol then
outputChatBox(\"(( A rab nincs a letartóztatási helyen! ))\" , thePlayer, 255, 0, 0)
else
local jailTimer = getElementData(targetPlayer, \"pd.jailtimer\")
local username = getPlayerName(thePlayer)
local reason = table.concat({...}, \" \")
if (jailTimer) then
outputChatBox(\"(( A játékos már börtönben van! ))\", thePlayer, 255, 0, 0)
else
local finebank = false
local targetPlayerhasmoney = exports.global:getMoney(targetPlayer, true)
local amount = tonumber(fine)
mysql:query_free(\"UPDATE characters SET money = money - \" .. amount .. \" WHERE id = \" .. getElementData( targetPlayer, \"dbid\" ) )
setPlayerMoney(targetPlayer, getPlayerMoney(targetPlayer) - amount)
local theTimer = setTimer(timerPDUnjailPlayer, 60000, 1, targetPlayer)
exports[\'anticheat-system\']:changeProtectedElementDataEx(targetPlayer, \"pd.jailserved\", 0, false)
exports[\'anticheat-system\']:changeProtectedElementDataEx(targetPlayer, \"pd.jailtime\", jailtime, false)
exports[\'anticheat-system\']:changeProtectedElementDataEx(targetPlayer, \"pd.jailtimer\", theTimer, false)
toggleControl(targetPlayer,\'next_weapon\',false)
toggleControl(targetPlayer,\'previous_weapon\',false)
toggleControl(targetPlayer,\'fire\',false)
toggleControl(targetPlayer,\'aim_weapon\',false)
local restrainedObj = getElementData(targetPlayer, \"restrainedObj\")
if restrainedObj then
toggleControl(targetPlayer, \"sprint\", true)
toggleControl(targetPlayer, \"jump\", true)
toggleControl(targetPlayer, \"accelerate\", true)
toggleControl(targetPlayer, \"brake_reverse\", true)
exports[\'anticheat-system\']:changeProtectedElementDataEx(targetPlayer, \"restrain\", 0)
exports[\'anticheat-system\']:changeProtectedElementDataEx(targetPlayer, \"restrainedBy\")
exports[\'anticheat-system\']:changeProtectedElementDataEx(targetPlayer, \"restrainedObj\")
if restrainedObj == 45 then
local dbid = getElementData(targetPlayer, \"dbid\")
exports[\'item-system\']:deleteAll(47, dbid)
end
exports.global:giveItem(thePlayer, restrainedObj, 1)
mysql:query_free(\"UPDATE characters SET cuffed = 0, restrainedby = 0, restrainedobj = 0 WHERE id = \" .. mysql:escape_string(getElementData( targetPlayer, \"dbid\" )) )
end
setPedWeaponSlot(targetPlayer,0)
exports[\'anticheat-system\']:changeProtectedElementDataEx(targetPlayer, \"pd.jailstation\", targetCol)
mysql:query_free(\"UPDATE characters SET pdjail=\'1\', pdjail_time=\'\" .. mysql:escape_string(jailtime) .. \"\', pdjail_station=\'\" .. mysql:escape_string(targetCol) .. \"\', cuffed = 0, restrainedby = 0, restrainedobj = 0 WHERE id = \" .. mysql:escape_string(getElementData( targetPlayer, \"dbid\" )) )
outputChatBox(\"(( Letartóztattad \" .. targetPlayerNick .. \"-t \" .. jailtime .. \" percre. ))\", thePlayer, 255, 0, 0)
setElementPosition(targetPlayer, 546.1142578125, -39.0595703125, 131.1242980957) setElementDimension(targetPlayer, 77 ) setElementInterior(targetPlayer, 11 )
setPedRotation(targetPlayer, 0)
setElementFrozen(source, false)
exports.global:givePlayerAchievement(thePlayer, 7)
exports.global:givePlayerAchievement(targetPlayer,
outputChatBox(\"(( \" .. username .. \" letartóztatott téged \" .. jailtime .. \" percre! ))\", targetPlayer, 0, 102, 255)
outputChatBox(\"(( Vád(ak): \" .. reason .. \". ))\", targetPlayer, 0, 102, 255)
takeAllWeapons ( targetPlayer )
SendMessageToTeam(\"Országos Rendőr Fő-kapitányság\", \"(( \" .. username .. \" letartóztatta \" .. targetPlayerNick .. \"-t! ))\", 0, 102, 255)
SendMessageToTeam(\"Országos Rendőr Fő-kapitányság\",\"(( Vád(ak): \" .. reason .. \". ))\", 0, 102, 255)
SendMessageToTeam(\"Országos Rendőr Fő-kapitányság\",\"(( Bírság: \" .. fine .. \" Ft. ))\", 0, 102, 255)
toggleAllControls ( targetPlayer, true, true, true )
exports.logs:logMessage(\"[PD/ARREST] \" .. username .. \" letartoztatta \" .. targetPlayerNick .. \"-t. Ido: \" .. jailtime .. \" perc. Oka: \"..reason , 30)
end
end
end
end
end
end
end
addCommandHandler(\"arrest\", arrestPlayer)
function timerPDUnjailPlayer(jailedPlayer, azonnali)
if(isElement(jailedPlayer)) then
local timeServed = tonumber(getElementData(jailedPlayer, \"pd.jailserved\"))
local timeLeft = getElementData(jailedPlayer, \"pd.jailtime\")
local username = getPlayerName(jailedPlayer)
if ( timeServed ) then
if (azonnali) and (azonnali == true) then
if(isTimer(theTimer)) then killTimer(theTimer) end
theMagicTimer = nil
fadeCamera(jailedPlayer, false)
mysql:query_free(\"UPDATE characters SET pdjail_time=\'0\', pdjail=\'0\', pdjail_station=\'0\' WHERE id=\" .. mysql:escape_string(getElementData(jailedPlayer, \"dbid\")))
setElementDimension(jailedPlayer, 0)
setElementInterior(jailedPlayer, 0)
setCameraInterior(jailedPlayer, 0)
setElementPosition(jailedPlayer, 1754.6796875, -1592.8974609375, 13.532894134521)
setPedRotation(jailedPlayer, 180)
exports[\'anticheat-system\']:changeProtectedElementDataEx(jailedPlayer, \"pd.jailserved\", 0, false)
exports[\'anticheat-system\']:changeProtectedElementDataEx(jailedPlayer, \"pd.jailtime\", 0, false)
exports[\'anticheat-system\']:changeProtectedElementDataEx(jailedPlayer, \"pd.jailtimer\")
exports[\'anticheat-system\']:changeProtectedElementDataEx(jailedPlayer, \"pd.jailstation\")
toggleControl(jailedPlayer,\'next_weapon\',true)
toggleControl(jailedPlayer,\'previous_weapon\',true)
toggleControl(jailedPlayer,\'fire\',true)
toggleControl(jailedPlayer,\'aim_weapon\',true)
fadeCamera(jailedPlayer, true)
outputChatBox(\"(( Letelt a büntetésed. ))\", jailedPlayer, 0, 255, 0)
outputDebugString(\"JAIL: \" .. getPlayerName(jailedPlayer) .. \" prémiumkártya elhasználva.\")
return
end
exports[\'anticheat-system\']:changeProtectedElementDataEx(jailedPlayer, \"pd.jailserved\", tonumber(timeServed)+1, false)
local timeLeft = timeLeft - 1
exports[\'anticheat-system\']:changeProtectedElementDataEx(jailedPlayer, \"pd.jailtime\", timeLeft, false)
if (timeLeft<=0) then
theMagicTimer = nil
fadeCamera(jailedPlayer, false)
mysql:query_free(\"UPDATE characters SET pdjail_time=\'0\', pdjail=\'0\', pdjail_station=\'0\' WHERE id=\" .. mysql:escape_string(getElementData(jailedPlayer, \"dbid\")))
setElementDimension(jailedPlayer, 0)
setElementInterior(jailedPlayer, 0)
setCameraInterior(jailedPlayer, 0)
setElementPosition(jailedPlayer, 1754.6796875, -1592.8974609375, 13.532894134521)
setPedRotation(jailedPlayer, 180)
exports[\'anticheat-system\']:changeProtectedElementDataEx(jailedPlayer, \"pd.jailserved\", 0, false)
exports[\'anticheat-system\']:changeProtectedElementDataEx(jailedPlayer, \"pd.jailtime\", 0, false)
exports[\'anticheat-system\']:changeProtectedElementDataEx(jailedPlayer, \"pd.jailtimer\")
exports[\'anticheat-system\']:changeProtectedElementDataEx(jailedPlayer, \"pd.jailstation\")
toggleControl(jailedPlayer,\'next_weapon\',true)
toggleControl(jailedPlayer,\'previous_weapon\',true)
toggleControl(jailedPlayer,\'fire\',true)
toggleControl(jailedPlayer,\'aim_weapon\',true)
fadeCamera(jailedPlayer, true)
outputChatBox(\"(( Letelt a büntetésed. ))\", jailedPlayer, 0, 255, 0)
elseif (timeLeft>0) then
mysql:query_free(\"UPDATE characters SET pdjail_time=\'\" .. mysql:escape_string(timeLeft) .. \"\' WHERE id=\" .. mysql:escape_string(getElementData(jailedPlayer, \"dbid\")))
local theTimer = setTimer(timerPDUnjailPlayer, 60000, 1, jailedPlayer)
exports[\'anticheat-system\']:changeProtectedElementDataEx(jailedPlayer, \"pd.jailtimer\", theTimer, false)
outputDebugString(\"JAIL: \" .. getPlayerName(jailedPlayer) .. \" has \".. timeLeft .. \" minutes left. New timer set.\")
end
end
end
end [code]