Facebook
From Sludgy Crocodile, 3 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 184
  1. function yereyatir(thePlayer, commandName, targetPlayerNick)
  2.         local logged = getElementData(thePlayer, "loggedin")
  3.         local targetPlayer, targetPlayerName = exports.global:findPlayerByPartialNick(thePlayer, targetPlayerNick)     
  4.        
  5.         if (getElementData(thePlayer, "faction")==1) then
  6.                 if not (targetPlayerNick) then
  7.                         outputChatBox("[Vortex Roleplay]:#ffffff /" .. commandName .. " [Player Partial Nick]", thePlayer, 255, 194, 14,true)
  8.                 else
  9.                         if (targetPlayer==thePlayer) then
  10.                                 outputChatBox("[!] #f0f0f0Kendini yere yatıramazsın.", thePlayer, 255, 0, 0, true)
  11.                                 return false
  12.                         end
  13.  
  14.                         if (getElementData(targetPlayer, "duty_admin")==1) then
  15.                                 outputChatBox("[!] #f0f0f0Görevdeki yetkiliyi yere yatıramazsın.", thePlayer, 255, 0, 0, true)
  16.                                 return false
  17.                         end            
  18.                
  19.                         if targetPlayer then
  20.                                 local x, y, z = getElementPosition(thePlayer)
  21.                                 local tx, ty, tz = getElementPosition(targetPlayer)
  22.                                
  23.                                 local distance = getDistanceBetweenPoints3D(x, y, z, tx, ty, tz)
  24.                                
  25.                                 if (distance<=10) then
  26.                                         detachElements(targetPlayer)
  27.                                         toggleAllControls(targetPlayer, false, true, false)
  28.                                         setElementFrozen(targetPlayer, true)
  29.                                         triggerClientEvent(targetPlayer, "onClientPlayerWeaponCheck", targetPlayer)
  30.                                         setPedWeaponSlot(targetPlayer, 0)
  31.                                         exports.anticheat:changeProtectedElementDataEx(targetPlayer, "freeze", 1, false)                               
  32.                                         setPedAnimation(targetPlayer, "CRACK", "crckidle2", -1, false, false, false)                                   
  33.                                         setElementFrozen(targetPlayer, true)
  34.                                         triggerEvent("sendLocalMeAction", root, thePlayer, " " .. targetPlayerName .. " kişisinin üstüne doğru atlar.")
  35.                                 else
  36.                                         outputChatBox("[!] #f0f0f0" .. targetPlayerName .. " isimli kişiden uzaksınız.", thePlayer, 255, 0, 0, true)
  37.                                 end
  38.                         end
  39.                 end
  40.         end
  41. end
  42. addCommandHandler("yereyatir", yereyatir)
  43.  
  44. function yereyatir(thePlayer, commandName, targetPlayerNick)
  45.         local logged = getElementData(thePlayer, "loggedin")
  46.         local targetPlayer, targetPlayerName = exports.global:findPlayerByPartialNick(thePlayer, targetPlayerNick)     
  47.        
  48.         if (getElementData(thePlayer, "faction")==1) then
  49.                 if not (targetPlayerNick) then
  50.                         outputChatBox("SYNTAX: /" .. commandName .. " [Player Partial Nick]", thePlayer, 255, 194, 14)
  51.                 else
  52.                         if (targetPlayer==thePlayer) then
  53.                                 outputChatBox("[!] #f0f0f0Kendini yere yatıramazsın.", thePlayer, 255, 0, 0, true)
  54.                                 return false
  55.                         end
  56.  
  57.                         if (getElementData(targetPlayer, "duty_admin")==1) then
  58.                                 outputChatBox("[!] #f0f0f0Görevdeki yetkiliyi yere yatıramazsın.", thePlayer, 255, 0, 0, true)
  59.                                 return false
  60.                         end            
  61.                
  62.                         if targetPlayer then
  63.                                 local x, y, z = getElementPosition(thePlayer)
  64.                                 local tx, ty, tz = getElementPosition(targetPlayer)
  65.                                
  66.                                 local distance = getDistanceBetweenPoints3D(x, y, z, tx, ty, tz)
  67.                                
  68.                                 if (distance<=10) then
  69.                                         detachElements(targetPlayer)
  70.                                         toggleAllControls(targetPlayer, false, false, false)
  71.                                         setElementFrozen(targetPlayer, false)
  72.                                         triggerClientEvent(targetPlayer, "onClientPlayerWeaponCheck", targetPlayer)
  73.                                         setPedWeaponSlot(targetPlayer, 0)
  74.                                         exports.anticheat:changeProtectedElementDataEx(targetPlayer, "freeze", 1, false)                               
  75.                                         setPedAnimation(targetPlayer, "CRACK", "crckidle2", -1, false, false, false)                                   
  76.                                         setElementFrozen(targetPlayer, false)
  77.                                         triggerEvent("sendLocalMeAction", root, thePlayer, " " .. targetPlayerName .. " kişisini yerden kaldırır.")
  78.                                 else
  79.                                         outputChatBox("[!] #f0f0f0" .. targetPlayerName .. " isimli kişiden uzaksınız.", thePlayer, 255, 0, 0, true)
  80.                                 end
  81.                         end
  82.                 end
  83.         end
  84. end
  85. addCommandHandler("yerdenkaldir", yereyatir)
  86.