• Defibrillators?
    15 replies, posted
Hey guys, I'm searching for defibrillators, but I can't seem to find any, if anyone has the script, or is willing to help me code the script, or just has a download like for it, I would greatly appreciate it.
most of the work is in the model and animation. find those then you'd probably have an easier time getting it to work.
I got the models / materials, where would I get the animation?
The model most likely has a fire animation, I know the PERP models do.
Maybe you can port the defib animations from l4d2?
I have models and materials, and I have an idea of the code I could make, but i'm unfamiliar with garry's mod functions, if someone could just chat with me and help me code this, I'll give you the code which you can sell or do whatever you want with it, I just really need this for my server.
-Why do i post at 3am-
[QUOTE=Deadman123;37162595]Just find the player's eye trace with objPl:GetEyeTrace() and then find the Entity with objPl:GetEyeTrace().Entity, check if its a player, and spawn them if it is with some sort of cooldown with timers. Simple. You need to make it so there is a respawn wait though. Look into the hook GM:PlayerDeathThink.[/QUOTE] A dead player's ragdoll wouldn't return a player.
[QUOTE=PencilOnDesk;37162970]A dead player's ragdoll wouldn't return a player.[/QUOTE] Fuck, I need sleep, its 3:17, I cant function correctly. :suicide:
@Deadman you know what your talking about, that's what PERP does, it traces the medic's eyes, than when he clicks, it finds a ragdoll, checks if it's a player, than runs a command which spawns the player, set's his position back where he died, and restores his inventory from his previous life. I just don't know how I would make it set his position and restore his inventory.
Find the player's death hook and run a SetPos on the victim's position and then if the defib spawns the player, set their spawn position with GetPos from the victim's position. For a rough idea look into these links: [URL="http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexf3f8.html"]Enitity Spawning[/URL] [URL="http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexf51f-2.html"]Entity Postion Acquiring[/URL] [URL="http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index7572.html"]Entity Position Setting[/URL] [URL="http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexbdc5.html"]Player Death[/URL]
PERP had an exploit where you could revive anyone from anywhere as it was all handled clientside, because all clients usually have a different spot for the dead players ragdoll.
[QUOTE=zzaacckk;37177355]PERP had an exploit where you could revive anyone from anywhere as it was all handled clientside, because all clients usually have a different spot for the dead players ragdoll.[/QUOTE] It seriously didn't at least check to make sure it was at a [i]graceful[/i] distance? Ah, that's funny.
[QUOTE=Katazuro;37176392]Find the player's death hook and run a SetPos on the victim's position and then if the defib spawns the player, set their spawn position with GetPos from the victim's position. For a rough idea look into these links: [URL="http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexf3f8.html"]Enitity Spawning[/URL] [URL="http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexf51f-2.html"]Entity Postion Acquiring[/URL] [URL="http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index7572.html"]Entity Position Setting[/URL] [URL="http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexbdc5.html"]Player Death[/URL][/QUOTE] how would I restore their inventory?
Not so sure, maybe swap it to respawn the player. Sorry, I don't have sufficient knowledge of how the inventory is managed though.
[QUOTE=ST20winD;37189051]how would I restore their inventory?[/QUOTE] [lua] hook.Add("DoPlayerDeath", "Save Weapons", function(client) client.storedWeapons = client:GetWeapons(); end); -- On your revive function: client:StripWeapons(); for k, v in pairs(client.storedWeapons) do client:Give(v); end; [/lua]
Sorry, you need to Log In to post a reply to this thread.