My favorites
▼
|
Sign in
evolvemod
An advanced admin mod for Garry's Mod.
Project Home
Issues
Source
Export to GitHub
READ-ONLY: This project has been
archived
. For more information see
this post
.
Search
Search within:
All issues
Open issues
New issues
Issues to verify
for
Advanced search
Search tips
Subscriptions
Issue
353
attachment: sh_freeze.lua
(2.6 KB)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*-------------------------------------------------------------------------------------------------------------------------
Freeze a player
-------------------------------------------------------------------------------------------------------------------------*/
local PLUGIN = {}
PLUGIN.Title = "Freeze"
PLUGIN.Description = "Freeze a player."
PLUGIN.Author = "Overv"
PLUGIN.ChatCommand = "freeze"
PLUGIN.Usage = "[players] [1/0]"
PLUGIN.Privileges = { "Freeze" }
function PLUGIN:Call( ply, args )
if ( ply:EV_HasPrivilege( "Freeze" ) ) then
local players = evolve:FindPlayer( args, ply, true )
local enabled = ( tonumber( args[ #args ] ) or 1 ) > 0
for _, pl in ipairs( players ) do
if ( enabled ) then
if (!pl.EV_Frozen) then
pl:Lock()
pl.EV_Frozen = true
else
pl:UnLock()
pl.EV_Frozen = false
end
end
end
if ( #players > 0 ) then
if ( enabled ) then
evolve:Notify( evolve.colors.blue, ply:Nick(), evolve.colors.white, " has frozen ", evolve.colors.red, evolve:CreatePlayerList( players ), evolve.colors.white, "." )
else
evolve:Notify( evolve.colors.blue, ply:Nick(), evolve.colors.white, " has unfrozen ", evolve.colors.red, evolve:CreatePlayerList( players ), evolve.colors.white, "." )
end
else
evolve:Notify( ply, evolve.colors.red, evolve.constants.noplayers )
end
else
evolve:Notify( ply, evolve.colors.red, evolve.constants.notallowed )
end
end
function PLUGIN:CanPlayerSuicide( ply ) if ( ply.EV_Frozen ) then return false end end
function PLUGIN:PlayerUse( ply ) if ( ply.EV_Frozen ) then return false end end
function PLUGIN:PlayerNoClip( ply ) if ( ply.EV_Frozen ) then return false end end
function PLUGIN:PlayerSpawnProp( ply ) if ( ply.EV_Frozen ) then return false end end
function PLUGIN:PlayerSpawnSENT( ply ) if ( ply.EV_Frozen ) then return false end end
function PLUGIN:PlayerSpawnSWEP( ply ) if ( ply.EV_Frozen ) then return false end end
function PLUGIN:PlayerSpawnNPC( ply ) if ( ply.EV_Frozen ) then return false end end
function PLUGIN:PlayerSpawnEffect( ply ) if ( ply.EV_Frozen ) then return false end end
function PLUGIN:PlayerSpawnRagdoll( ply )if ( ply.EV_Frozen ) then return false end end
function PLUGIN:PlayerSpawnedVehicle( ply, veh )if ( ply.EV_Frozen ) then veh:Remove() end end
function PLUGIN:Menu( arg, players )
if ( arg ) then
table.insert( players, arg )
RunConsoleCommand( "ev", "freeze", unpack( players ) )
else
return "Freeze", evolve.category.punishment, { { "Enable", 1 }, { "Disable", 0 } }
end
end
evolve:RegisterPlugin( PLUGIN )
Powered by
Google Project Hosting