Scripts Removed

Decided to use the scripts for personal reasons and have removed them from my drive, if you have the scripts already please do not re-upload them without my permission.

4 Likes

Nice share ! But RPDeath download link it’s the link of Hospital :frowning:

It seems you accidentally copied pasted the same link twice.

Thanks, fixed it in the original post.

… but exports.spawnmanager:setAutoSpawnCB?

Hello, can you do when we die, we reappear to hospital directly without type /toggleDeath plz?

I’m assuming you mean the RPDeath script, edit the client.lua file (use notepad++ or something similar) and change local RPDeathEnabled = true to local RPDeathEnabled = false. This should make people respawn at one of the 5 hospitals after 3 seconds when they die. To enable the script they will need to type /toggleDeath in chat.

Also, when you are dead and the script is enabled you should be typing /respawn, /revive, or /revive <id> to respawn or revive the player.

I would also re-download the script as I just updated RPDeath’s client.lua file as there was some weird stuff going on with variables being declared in two places. If you re-download and follow the above steps you should be good.

Hello, how to replace commands (/respawn, /revive, …) by a pressed key, please help me, it’s very important !

for /respawn

Citizen.CreateThread(function()
  while true do
 	Citizen.Wait(1)


 if IsControlJustPressed(--[[input group]],  --[[control index]]) then

 
 TriggerEvent("RPD:allowRespawn")



    end
  end
end)
1 Like

Thanks !!! It work !

cant get hospital to work, anyone else?

Can you share the error message you are getting?

It should work, try and tell me if its okay

players = {}

RegisterServerEvent('RPD:addPlayer')
AddEventHandler('RPD:addPlayer', function()
	players[source] = true
end)

AddEventHandler('playerDropped',function(reason)
	players[source] = nil
end)


AddEventHandler('chatMessage', function(from,name,message)
	if(message:sub(1,1) == "/") then

		local args = splitString(message, " ")
		local cmd = args[1]


		if (cmd == "/respawn") then
			CancelEvent()
			TriggerClientEvent('RPD:allowRespawn', from)
		end

		if (cmd == "/toggleDeath") then
			CancelEvent()
			TriggerClientEvent('RPD:toggleDeath', from)
		end

		if (cmd == "/revive") then
			CancelEvent()
			

			if (args[2] ~= nil) then
			    local fromid = tonumber(args[1])
				local playerID = tonumber(args[2])
				
				TriggerEvent('es:getPlayerFromId', fromid, function(user)

				if(playerID == nil or players[playerID] == nil) then
					TriggerClientEvent('chatMessage', from, "RPDeath", {200,0,0} , "Invalid PlayerID")
					return
				end
				
				if user.permission_level == (3) then

				TriggerClientEvent('RPD:allowRevive', playerID)

				TriggerClientEvent('chatMessage', from, "RPDeath", {200,0,0} , "Player revived")
				
			  end
			end
		end
	end
  end)
end)


function splitString(self, delimiter)
	local words = self:Split(delimiter)
	local output = {}
	for i = 0, #words - 1 do
		table.insert(output, words[i])
	end

	return output
end

i cannot get it to teleport to hospital or anywhere, anyone else got this working without error?

Hi I come to you to tell you something that would not hurt.
For example when you die then you are not revived that you are sent directly to your hospital script and have to wait for example 300 seconds by default then to be released to a hospital.

It would be a set of your 2 scripts that could be good!

1 Like

Not working with Advanced RP :confused:

1 Like

Haven’t looked at anything ES related and I created these before AdvancedRP was dumped so I’m not surprised that something could be conflicting.

I’ll try my best to figure it out but I could use some info to go off of.

  1. Which script(s) are you trying to use?
  2. Are you are getting any error messages (in the F8 console or the Server Window)? If so please post it here.

Hello thanks your scripts my i have a small problem with
1 qaund I change the time of respawn I never respawn
2 would it be possible to add a permision to the command / revive?
thank you

Hi eferati, when you say that you “never respawn” is that while the script is enabled or did you disabled it via /toggleDeath? When you are dead and the script is enabled typing /respawn or /revive in that chat should respawn or revive you.

When the script is disabled it should make you automatically respawn at one of the hospitals after 3 seconds.

As for your second question it could be done, you would just check that the player issuing the command also has the permissions required. I haven’t looked at or installed essentialmode yet so I can’t give any code examples but that’s generally how you would do it.

It does not work you have other solution because I try since a while ago but I can not get there