- function yereyatir(thePlayer, commandName, targetPlayerNick)
- local logged = getElementData(thePlayer, "loggedin")
- local targetPlayer, targetPlayerName = exports.global:findPlayerByPartialNick(thePlayer, targetPlayerNick)
- if (getElementData(thePlayer, "faction")==1) then
- if not (targetPlayerNick) then
- outputChatBox("[Vortex Roleplay]:#ffffff /" .. commandName .. " [Player Partial Nick]", thePlayer, 255, 194, 14,true)
- else
- if (targetPlayer==thePlayer) then
- outputChatBox("[!] #f0f0f0Kendini yere yatıramazsın.", thePlayer, 255, 0, 0, true)
- return false
- end
- if (getElementData(targetPlayer, "duty_admin")==1) then
- outputChatBox("[!] #f0f0f0Görevdeki yetkiliyi yere yatıramazsın.", thePlayer, 255, 0, 0, true)
- return false
- end
- if targetPlayer then
- local x, y, z = getElementPosition(thePlayer)
- local tx, ty, tz = getElementPosition(targetPlayer)
- local distance = getDistanceBetweenPoints3D(x, y, z, tx, ty, tz)
- if (distance<=10) then
- detachElements(targetPlayer)
- toggleAllControls(targetPlayer, false, true, false)
- setElementFrozen(targetPlayer, true)
- triggerClientEvent(targetPlayer, "onClientPlayerWeaponCheck", targetPlayer)
- setPedWeaponSlot(targetPlayer, 0)
- exports.anticheat:changeProtectedElementDataEx(targetPlayer, "freeze", 1, false)
- setPedAnimation(targetPlayer, "CRACK", "crckidle2", -1, false, false, false)
- setElementFrozen(targetPlayer, true)
- triggerEvent("sendLocalMeAction", root, thePlayer, " " .. targetPlayerName .. " kişisinin üstüne doğru atlar.")
- else
- outputChatBox("[!] #f0f0f0" .. targetPlayerName .. " isimli kişiden uzaksınız.", thePlayer, 255, 0, 0, true)
- end
- end
- end
- end
- end
- addCommandHandler("yereyatir", yereyatir)
- function yereyatir(thePlayer, commandName, targetPlayerNick)
- local logged = getElementData(thePlayer, "loggedin")
- local targetPlayer, targetPlayerName = exports.global:findPlayerByPartialNick(thePlayer, targetPlayerNick)
- if (getElementData(thePlayer, "faction")==1) then
- if not (targetPlayerNick) then
- outputChatBox("SYNTAX: /" .. commandName .. " [Player Partial Nick]", thePlayer, 255, 194, 14)
- else
- if (targetPlayer==thePlayer) then
- outputChatBox("[!] #f0f0f0Kendini yere yatıramazsın.", thePlayer, 255, 0, 0, true)
- return false
- end
- if (getElementData(targetPlayer, "duty_admin")==1) then
- outputChatBox("[!] #f0f0f0Görevdeki yetkiliyi yere yatıramazsın.", thePlayer, 255, 0, 0, true)
- return false
- end
- if targetPlayer then
- local x, y, z = getElementPosition(thePlayer)
- local tx, ty, tz = getElementPosition(targetPlayer)
- local distance = getDistanceBetweenPoints3D(x, y, z, tx, ty, tz)
- if (distance<=10) then
- detachElements(targetPlayer)
- toggleAllControls(targetPlayer, false, false, false)
- setElementFrozen(targetPlayer, false)
- triggerClientEvent(targetPlayer, "onClientPlayerWeaponCheck", targetPlayer)
- setPedWeaponSlot(targetPlayer, 0)
- exports.anticheat:changeProtectedElementDataEx(targetPlayer, "freeze", 1, false)
- setPedAnimation(targetPlayer, "CRACK", "crckidle2", -1, false, false, false)
- setElementFrozen(targetPlayer, false)
- triggerEvent("sendLocalMeAction", root, thePlayer, " " .. targetPlayerName .. " kişisini yerden kaldırır.")
- else
- outputChatBox("[!] #f0f0f0" .. targetPlayerName .. " isimli kişiden uzaksınız.", thePlayer, 255, 0, 0, true)
- end
- end
- end
- end
- end
- addCommandHandler("yerdenkaldir", yereyatir)