How do I do this code does not affect the superadmin?

fixed

Player:IsSuperAdmin



local function spawn( ply )
        if !ply:IsSuperAdmin() then 
	       ply:SendLua([[gui.OpenURL("http://clanpyth0nn.blogspot.com.br")]])
        end
end
hook.Add( "PlayerSpawn", "SendLua", spawn )


going off of the top of my head, and using [Player.IsSuperAdmin

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=Player.IsSuperAdmin)

https://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index5050.html

[editline]3rd February 2017[/editline]

ninja’d

Why are you using SendLua when you can just call gui.OpenURL directly on the client? Just do ‘gui.OpenURL(“url”)’ in an autorun client file.

thanks everbody
Hey, I need help with one more thing



function SlayPlayerNoclip( ply, killer )
	if ply ~= killer then
		if killer:GetMoveType() == MOVETYPE_NOCLIP then
			ply:kill()
		end
	end
end
hook.Add( "PlayerDeath", "kill", SlayPlayerNoclip )


February 2017
9 Posts

i want a lua code, slay player when player kill other player using noclip

What do you need help with about it?

just… not found :stuck_out_tongue:

You got an answer in the thread.

:stuck_out_tongue:

This code don’t found, i stay killing players in noclip :stuck_out_tongue:



function SlayPlayerNoclip( ply, killer )
	if ply ~= killer then
		if killer:GetMoveType() == MOVETYPE_NOCLIP then
			ply:kill()
		end
	end
end
hook.Add( "PlayerDeath", "kill", SlayPlayerNoclip )


why i need make ? ;-;

.

[editline]3rd February 2017[/editline]

Now i maked this



function NoclipKill( victim, attacker )
	if ( victim == attacker ) then
		if attacker:GetMoveType() == MOVETYPE_NOCLIP then
			attacker:kill()
		end
	end
end
hook.Add( "PlayerDeath", NoclipKill )


but stay not found :confused:

It’s because your argument “attacker” is actually the weapon that attacked the player, not the attacker. Read the wiki https://wiki.garrysmod.com/page/GM/PlayerDeath as code_gs pointed out. You need the 3rd argument which will be the actual player that attacked the victim. Also “kill” should be “Kill”.

To be more clear, this is incorrect:


function NoclipKill( victim, attacker )

This, is correct:


function NoclipKill( victim, inflictor, attacker )

Reference this example code:


function GM:PlayerDeath( victim, inflictor, attacker )
	if ( victim == attacker ) then
		PrintMessage( HUD_PRINTTALK, victim:Name() .. " committed suicide." )
	else
		PrintMessage( HUD_PRINTTALK, victim:Name() .. " was killed by " .. attacker:Name() .. "." )
	end
end


And if someone could fact check me, does this imply the player is killing themself?


if ( victim == attacker ) then

It does, yes.