I’m sorry for the very late response, but you can just add this
RemoveAllPedWeapons(PlayerPedId(), false)
anywhere between the 157th-159th
line in the client.lua for the mass respawn. ex; (/adres all).
and between the 164th-166th
line in the client.lua for a specific respawn. ex; (/respawn) and (/adrev [ID]).
the thing is I have weapons as items, so I’m trying to know how to remove all items from the inventory/database
can i change the prefix or the command to /r insted of /respawn?
Absolutely, you can change it however you like.
Sorry for asking something that might seem obvious, but I somehow am unable to figure this out: How do I revive other players on my server?
When someone dies and I try to put in “/revive 2” in the chat window (as vMenu tells me that 2 the ID of that particular player), I always get the message “you are alive”. Putting in the player’s name also does not seems do anything. I guess I am doing something wrong somewhere along the line here, but where and how eludes me. The normal operation - i.e. players reviving/healing themselves - does work.
I appreciate any help to get this to work. Thank you!
how do i change the respawn location
So where exatcly do i put this in?
client Function or server?
Hey,
sorry for the… VERY late response, but; you’d use /revive to revive yourself and /respawn to respawn yourself, on the other hand, /adrev (admin revive) is used to revive other people instantly and /adres (admin respawn) to respawn other people instantly.
I apologize for all the confusion, I believe I should’ve mentioned how to use the resource in the description when I posted it, and that’s on my part, the description will be updated in the next few minutes.
hey adrianr,
you basically add it to your permissions.cfg
file, and if you don’t have one, just create a file called permissions with the .cfg
extension, then add exec permissions.cfg
to your server.cfg
.
Hey Peanutbutt,
head to the client.lua
file and down to lines number 71 - 75…
those are the spawn location, you can add using this format
createSpawnPoint(x1, x2, y1, y2, z, heading)
x1
and x2
are values of the X
coordinates, you’d want to set those in the general area,
y2
and y2
are values of the Y
coordinates, you’d want to set those in the general area as well,
z
is the value of the Z
coordinate, you need to set this to the true position,
heading
is the value of the player’s heading (where the character should be looking when they spawn), you need a true heading.
example; createSpawnPoint(372, 375, -596, -594, 30.0, 0) -- Pillbox Hill
The 372
and the 375
are the general area for the X
axis, meaning; a player would spawn anywhere between those two X
coordinates, then; -596
and -594
are the general area for the Y
axis, again meaning; a player would spawn anywhere between those two Y
coordinates, and 30.0
is the true Z
coordinate, meaning; a player will spawn at that exact position, finally; the heading, is where should the spawning character be facing.
hope this helps, good luck
[v2.0] DeathScript
Version 2.0 has been released and with it comes new features, bugs fixes, and performance improvement.
A new config file was added sh_config.js
, everything configurable is located inside it, messages, timers, and everything, mappable keys for a customizable quick revive and respawn, exports for external use, and more…
The post details were updated to match the new version, make sure to check it out.
have fun and happy coding…
Hey. Nice Tool. How can i set a default keybind in the sh_config.js?
DefaultKeybind: ' ??? ' // The default keybind, every play can customize it to their own preference
Hey,
As of now, keybinds are only available for the “Revive” and “Respawn” commands, the rest will be supported soon due to some complications.
but, head over to this page " KEYBOARD - Cfx.re Docs (fivem.net)", and you’ll find all the keyboard keys.
the table is divided into two columns, Input Parameter, and Input Description, the input parameter is what you need.
ex:
you would do;
Revive: {
Enabled: true, // Weather is the command enabled, cannot be toggle from in-game
Keybind: {
Enabled: true, // Weather the command's keybind is enabled or not, cannot be toggle from in-game
DefaultKeybind: 'NUMPAD3' // The default keybind, every play can customize it to their own preference
},
WaitTime: 240, // The default wait time the player has to wait before they can use the command // TIME IN SECONDS \\
Messages: { // The messages use in the command, I don't think you have to touch anything, but; you do you
Revive: ['^3(INFO)^0', ' ^3You were revived.'],
Alive: ['^3(INFO)^0', ' ^3You are alive.'],
},
Suggestion: { // The suggestion or the text box that shows when you type the command, it will help people who aren't familiar with the command's usage, and I doubt you'd need to change anything here
name: '/revive', help: 'Revive yourself after revive timer is out.'
}
}
this will set the default keybind for the Revive
command to NUMPAD3
.
I hope this answers your question,
[v2.1.1] DeathScript
Version 2.1.1 has been released and with it comes the addition of keybinds for Admin revive and respawn, a fix for default keybinds not working, a better auto respawn for when the script is toggled, and a cooldown for Adrev & Adres to prevent spamming.
The post details will be updated to match the new version shortly, make sure to check it out.
have fun and happy coding…
Experiencing an Issue - player does not teleport to hospital when using /respawn.
Hi there, I can’t seem to figure out why when using the /respawn command it does not teleport the character to hospital, instead it does the cloud animation but then revives them at their death location.
I have not changed your config in anyway so far.
Do you have any solution to my issue?
Thank you, I look forward to your response.
Hello SkiddyPiglet,
The issue will be discussed in the issue card you’ve opened on the GitHub Repository, thank you for your feedback.
would anyone be able to help me restrict the /revive command so just my ems can use it please
Hey,
By default the revive and respawn commands do not have permissions nor they’re restricted by any means, allowing players to revive/respawn themselves in the absence of admins or ems/fire.
but you could make a duplicate of the “adrev” & “adres” command and rename them to whatever name and change the required ace permission, everything else should work just fine, no need to change or alter any other function.
/**
* EMS revive
*/
RegisterCommand('emsrevive', (source, args) => {
if (IsPlayerAceAllowed(source, 'DeathScript.EMSrevive')) { // THIS IS THE ACE PERMISSION "DeathScript.EMSrevive"
const Player = args[0] || source;
if (ValidatePlayer(source, Player, 'AdRev')) {
const Ped = GetPlayerPed(Player);
if (GetEntityHealth(Ped) > 1) {
if (Player === source) {
SendMessage(source, Config.Commands.AdRev.Messages.ToStaff.Usage);
} else {
SendMessage(source, Config.Commands.AdRev.Messages.ToStaff.Alive);
}
} else {
emitNet('DeathScript:Admin:Revive', Player, source, false);
if (Player === source) {
SendMessage(source, Config.Commands.AdRev.Messages.ToStaff.Revived);
} else {
SendMessage(source, Config.Commands.AdRev.Messages.ToStaff.Revived);
SendMessage(Player, Config.Commands.AdRev.Messages.ToPlayer.Revived);
}
}
}
} else {
SendMessage(source, Config.Commands.AdRev.Messages.ToStaff.NoPermission);
}
});
/**
* EMS Respawn
*/
RegisterCommand('emsrespawn', (source, args) => {
if (IsPlayerAceAllowed(source, 'DeathScript.EMSrespawn')) { // THIS IS THE ACE PERMISSION "DeathScript.EMSrespawn"
const Player = args[0] || source;
if (ValidatePlayer(source, Player, 'AdRes')) {
const Ped = GetPlayerPed(Player);
if (GetEntityHealth(Ped) > 1) {
if (Player === source) {
SendMessage(source, Config.Commands.AdRes.Messages.ToStaff.Usage);
} else {
SendMessage(source, Config.Commands.AdRes.Messages.ToStaff.Alive);
}
} else {
emitNet('DeathScript:Admin:Respawn', Player, source, false);
if (Player === source) {
SendMessage(source, Config.Commands.AdRes.Messages.ToStaff.Respawned);
} else {
SendMessage(source, Config.Commands.AdRes.Messages.ToStaff.Respawned);
SendMessage(Player, Config.Commands.AdRes.Messages.ToPlayer.Respawned);
}
}
}
} else {
SendMessage(source, Config.Commands.AdRes.Messages.ToStaff.NoPermission);
}
});
}
This is just an example on how to do it, it works
best of luck
I have followed the instructions listed along with some of the replies in the comments but my permission still are not working. I have added the ace to the permissions.cfg as the following “add_ace group.admin command.adrev” Still get the “you do not have perms” in game. I have myself added as an admin in the vemnu permissions already as well. Am I missing something? Could really use some help.
Hey loffy404,
I understand your frustration, let me provide some clarifications.
You’ve done it right, you did
add_ace group.admin command.adrev
The command line itself is correct, but the ace permission isn’t.
The correct permission would be "DeathScript.AdRev"
and not command.adrev
.
And the same goes for ever permission in the resource.
So the command line would look like this
add_ace group.admin “DeathScript.AdRev”
Hope this clears out your confusion, good luck
P.S: the quotation marks could be wrong as I’m trying to guess which is the correct one from my phone, so replace them with the correct one on your keyboard if mine don’t work.