0% found this document useful (0 votes)
73 views3 pages

FiveM Revive Script Overview

The document contains code for a gaming script that includes functionalities for reviving players and healing them within a game environment. It defines command handlers for actions such as checking alive players, reviving a player from death, and healing a player, specifically for members of the Los Santos Fire Department. The script also includes checks for player status and interactions, along with output messages for user feedback.

Uploaded by

zeguiteyouness
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
73 views3 pages

FiveM Revive Script Overview

The document contains code for a gaming script that includes functionalities for reviving players and healing them within a game environment. It defines command handlers for actions such as checking alive players, reviving a player from death, and healing a player, specifically for members of the Los Santos Fire Department. The script also includes checks for player status and interactions, along with output messages for user feedback.

Uploaded by

zeguiteyouness
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

--[[ -- ‫ ألإصدار القادم سيتم فتح هذا‬-

---addCommandHandler("alive", getAlivePlayers, false, false)


--function getAlivePlayers( alivePlayersList )
function alivePlayers( getAlivePlayers, alivePlayersList ) --()
if ( alivePlayers ) then -- if we got the table
alivePlayersList = "none"
-- Loop through the table
for playerKey, playerValue in ipairs(alivePlayers) do
-- add their name to the list
if ( alivePlayersList == "none" ) then
alivePlayersList = getPlayerName ( playerValue )
else
alivePlayersList = alivePlayersList .. ", " .. getPlayerName
( playerValue )
end
end
outputChatBox ( alivePlayersList .. " : ‫الالعبين الذين هم على قيد الحياة‬: ")
end
addCommandHandler("aaa" ,getAlivePlayers, alivePlayersList)
]]
--revive script by: sRT, Richard C' Lugovoi
function revivePlayerFromPK(thePlayer, commandName, targetPlayer)
--local theTeam = getPlayerTeam(thePlayer)

--if (teamID==1 or teamID==2 or teamID==3 or teamID==47 or teamID==59)


then
-- if
[Link]:hasItem(thePlayer, 70) then
-- [Link]:takeItem(thePlayer, 70)
-- outputChatBox("You have revived And Take From
You 500$", thePlayer, 0, 255, 0)
if getPlayerTeam( thePlayer ) == getTeamFromName( "Los Santos Fire
Department" ) then
if not (targetPlayer) then
outputChatBox("SYNTAX: /" .. commandName .. " [Player Partial
Name / ID]", thePlayer, 255, 194, 14)
else
local targetPlayer, targetPlayerName =
[Link]:findPlayerByPartialNick(thePlayer, targetPlayer)

if targetPlayer then
if getElementData(targetPlayer, "dead") == 1 or
isPedDead(targetPlayer) then
triggerClientEvent(targetPlayer,"es-
system:closeRespawnButton",targetPlayer)
--fadeCamera(thePlayer, true)
--outputChatBox("Respawning...", thePlayer)
if isTimer(changeDeathViewTimer) == true then
killTimer(changeDeathViewTimer)
end

local x,y,z = getElementPosition(targetPlayer)


local int = getElementInterior(targetPlayer)
local dim = getElementDimension(targetPlayer)
local skin = getElementModel(targetPlayer)
local team = getPlayerTeam(targetPlayer)

setPedHeadless(targetPlayer, false)
setCameraInterior(targetPlayer, int)
setCameraTarget(targetPlayer, targetPlayer)
setElementData(targetPlayer, "dead", 0)
spawnPlayer(targetPlayer, x, y, z, 0)--, team)
--(team ~= "Los Santos Emergency Services")

setElementModel(targetPlayer,skin)
setPlayerTeam(targetPlayer, team)
setElementInterior(targetPlayer, int)
setElementDimension(targetPlayer, dim)
triggerEvent("updateLocalGuns", targetPlayer)
--local adminTitle =
tostring([Link]:getPlayerAdminTitle(thePlayer))
outputChatBox("The medic
"..tostring(getPlayerName(thePlayer):gsub("_"," ")).." has been revived you",
targetPlayer, 0, 255, 0)
outputChatBox("You have revived
"..tostring(getPlayerName(targetPlayer):gsub("_"," "))..".", thePlayer, 0, 255, 0)
--if [Link]:hasItem(thePlayer, 34) then
-- [Link]:takeItem(thePlayer, 34)
-- outputChatBox("You have revived And Take From
You 500$", thePlayer, 0, 255, 0)
[Link]:sendMessageToAdmins("AdmCmd:
"..getPlayerName(thePlayer).." mrevived
"..tostring(getPlayerName(targetPlayer))..".")
[Link]:dbLog(thePlayer, 4, targetPlayer,
"REVIVED from PK")
else

outputChatBox(tostring(getPlayerName(targetPlayer):gsub("_"," ")).." is not


dead.", thePlayer, 255, 0, 0)
end
end
end
end
end
addCommandHandler("mrevive", revivePlayerFromPK, false, false)
addCommandHandler("frevive", revivePlayerFromPK, false, false)

-- /mrevive system by sRT


function adminHeal(thePlayer, commandName, targetPlayer)
if getPlayerTeam( thePlayer ) == getTeamFromName( "Los Santos Fire
Department" ) then -- ‫اسم الفاكشن‬
local health = 100
local targetPlayerName = getPlayerName(thePlayer):gsub("_", " ")
if not (targetPlayer) then
targetPlayer = thePlayer
else
targetPlayer, targetPlayerName =
[Link]:findPlayerByPartialNick(thePlayer, targetPlayer)
end

if [Link]:hasMoney(thePlayer, 200) then -- ‫سعرالمعالجة‬


[Link]:takeMoney(thePlayer, 200) -- ‫سعر المعالجة‬
outputChatBox("t5alast mn 3andak 200$", thePlayer, 0, 255, 0)
-- ‫ ومعالجتك‬200 ‫رسالةتم اذ منك‬
else
outputChatBox("ma3andakch flouss", thePlayer, 0, 255, 0)
end
if targetPlayer then
setElementHealth(targetPlayer, tonumber(health))
-- outputChatBox("The Medic " .. targetPlayerName .. " Has Treat You
, Now Your Health : " .. getAlivePlayers .. " Health.", thePlayer, 0, 255, 0)
outputChatBox("The medic " .. targetPlayerName .. " has treah you
, now your health : " .. health .. " health.", thePlayer, 0, 255, 0)
else
triggerEvent("onPlayerHeal", targetPlayer, true)
[Link]:dbLog(thePlayer, 4, targetPlayer, "AHEAL "..health)
end
end
end
addCommandHandler("maheal", adminHeal, false, false) -- ‫ ألتكملةالحلقة القادمة‬sRT,
Richard C' Lugovoi

You might also like