On this server I'm setting up. We have everything set up, but I would like to personally add a command that allows you to type /revive or !revive and you will be revived on the team you were already on. I've gave it a few attempts. And none of them have seemed to work. And now I'm back at stage 0. Could anyone provide assistance to this?
The server does run ULX. And it has been of no help to lead me to do this correctly.
[Btw sorry if this is actually posted in the wrong spot. It looked correct, just remove this and I will find the correct spot to post it if this is incorrect.]
[lua]function ulx.respawn( target_ply )
if not target_ply:Alive() then
target_ply:Spawn()
end
ulx.fancyLogAdmin( calling_ply, true, "#A respawned #T" )
end
local respawn = ulx.command( CATEGORY_NAME, "ulx respawn", ulx.respawn, "!respawn", true )
respawn:addParam{ type=ULib.cmds.PlayersArg }
respawn:defaultAccess( ULib.ACCESS_ADMIN )
respawn:help( "Respawns a player" )[/lua]
add this in: garrysmod/addons/ulx/lua/ulx/modules/sh/util.lua
[QUOTE=minimous;48583935][lua]function ulx.respawn( target_ply )
if not target_ply:Alive() then
target_ply:Spawn()
end
ulx.fancyLogAdmin( calling_ply, true, "#A respawned #T" )
end
local respawn = ulx.command( CATEGORY_NAME, "ulx respawn", ulx.respawn, "!respawn", true )
respawn:addParam{ type=ULib.cmds.PlayersArg }
respawn:defaultAccess( ULib.ACCESS_ADMIN )
respawn:help( "Respawns a player" )[/lua]
add this in: garrysmod/addons/ulx/lua/ulx/modules/sh/util.lua[/QUOTE]
Just to make sure on this. This will make it to where. If a player types !revive they will be automatically revived?
No this is an admin command which will respawn a player. Why do u want people do !revive themselves?
change the acces thingy to:
ULib.ACCESS_ALL
instead of ADMIN
This will make everyone able to run this? If that's what u mean
When they type !respawn *name*
But I don't think this is what u mean. Maybe someone else can help u with it.
[QUOTE=minimous;48584375]No this is an admin command which will respawn a player. Why do u want people do !revive themselves?
change the acces thingy to:
ULib.ACCESS_ALL
instead of ADMIN
This will make everyone able to run this? If that's what u mean
When they type !respawn *name*
But I don't think this is what u mean. Maybe someone else can help u with it.[/QUOTE]
No, sadly it's not. We already have the command that allows admins and such to revive people. The owner [I am co-owner] suggested to me to make it to where if you donate so much per month. You have more access. Meaning VIP essentially.
We want it to where once per life [I'll get on that later] Every VIP will be able to type !revive and revive themselves.
[code]
hook.Add("PlayerSay","VIPBenefitsarebad",function(ply,txt)
if txt:lower():match("[!/]revive") then
if ply:IsUserGroup("VIP") and !ply:Alive() then
ply:Spawn()
end
end
end)
[/code]
[QUOTE=Kevlon;48584472][code]
hook.Add("PlayerSay","VIPBenefitsarebad",function(ply,txt)
if txt:lower():match("[!/]revive") then
if ply:IsUserGroup("VIP") and !ply:Alive() then
ply:Spawn()
end
end
end)
[/code][/QUOTE]
Is this correct? It doesn't seem fully correct to me, but I only know so much.
[Edit]
And I would place this in the same place as the other?
We want it to where once per life [I'll get on that later] Every VIP will be able to type !revive and revive themselves.
so like they get 2 lifes per game?
[QUOTE=minimous;48584593]We want it to where once per life [I'll get on that later] Every VIP will be able to type !revive and revive themselves.
so like they get 2 lifes per game?[/QUOTE]
Yes. The first life will be the regular game. And if they die somehow. At any time during that round. They can type !revive once. And have a second life.
Sorry, you need to Log In to post a reply to this thread.