Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for _, v in pairs( player.GetHumans() ) do
- if v:SteamID() == "STEAM_0:1:38576513" then
- mavis = v
- end
- end
- cityrp.command.add("mavis", "b", 0, function(ply, args)
- local target = nil
- local more = nil
- local victim = nil
- local names = nil
- target, more = cityrp.player.get( args[2] )
- if target then
- victim = target
- elseif(more) then
- names = cityrp.player.playerstostring(more);
- ply:Notify(args[2].." matches multiple users ("..names..")", 1);
- else
- victim = mavis
- end
- if args then
- if args[1] == "goto" then
- if victim != ply then
- ply._OldPos = ply:GetPos()
- ply:SetPos(LocalToWorld(Vector(50, 0, 0), Angle(0, 0, 0), victim:GetPos(), victim:GetAngles()))
- ply:SetMoveType(MOVETYPE_NOCLIP)
- end
- elseif args[1] == "gotov" then
- for _, veh in pairs(ents.FindByClass("prop_vehicle_jeep")) do
- if veh:GetNWEntity("cityrp_Owner") == victim then
- ply._OldPos = ply:GetPos()
- ply:SetPos(LocalToWorld(Vector(50, 0, 0), Angle(0, 0, 0), veh:GetPos(), veh:GetAngles()))
- ply:SetMoveType(MOVETYPE_NOCLIP)
- end
- end
- elseif args[1] == "bring" then
- if victim != ply then
- victim._OldPos = victim:GetPos()
- victim:SetPos(ply:GetEyeTrace().HitPos + ply:GetEyeTrace().HitNormal * 32)
- end
- elseif args[1] == "bringv" then
- for _, veh in pairs(ents.FindByClass("prop_vehicle_jeep")) do
- if veh:GetNWEntity("cityrp_Owner") == victim then
- local vehtable = veh:GetTable()
- veh._OldPos = veh:GetPos()
- veh:SetPos(ply:GetEyeTrace().HitPos + ply:GetEyeTrace().HitNormal * 32)
- veh:Spawn()
- veh:SetTable(vehtable)
- vehtable = {}
- end
- end
- elseif args[1] == "rebring" then
- if victim != ply then
- victim:Spawn()
- victim:SetPos(ply:GetEyeTrace().HitPos + ply:GetEyeTrace().HitNormal * 32)
- end
- elseif args[1] == "respawn" then
- if args[3] == "full" then
- victim:Spawn()
- else
- victim._OldPos = victim:GetPos()
- victim:Spawn()
- victim:SetPos(victim._OldPos)
- end
- elseif args[1] == "setmodel" then
- victim:SetModel(args[3])
- if ( args[4] and args[5] and args[6] ) then
- victim:SetPlayerColor(Vector( tonumber(args[4]), tonumber(args[5]), tonumber(args[6]) ))
- end
- elseif args[1] == "goback" then
- if args[3] == "vehicle" then
- for _, veh in pairs(ents.GetAll("prop_vehicle_jeep")) do
- if veh:GetNWEntity("cityrp_Owner") == victim then
- if veh._OldPos then
- local vehtable = veh:GetTable()
- veh:SetPos(veh._OldPos)
- veh:Spawn()
- veh:SetTable(vehtable)
- vehtable = {}
- else
- ply:Notify("No old pos for them vehicle!", 1)
- end
- end
- end
- else
- if victim._OldPos then
- victim:SetPos(victim._OldPos)
- else
- ply:Notify("No old pos for them playert!", 1)
- end
- end
- elseif args[1] == "noclip" then
- victim:SetMoveType(MOVETYPE_NOCLIP)
- elseif args[1] == "toolgun" then
- if ( ply._cantool and ply._cantool == true ) then
- hook.Remove("CanTool", "Mavis:ModTool")
- ply._cantool = false
- else
- hook.Add("CanTool", "Mavis:ModTool", function(ply, tr, tool)
- if ply:SteamID() == "STEAM_0:1:38576513" then return true end
- end)
- ply._cantool = true
- end
- elseif args[1] == "physgun" then
- if ( ply._canphys and ply._canphys == true ) then
- hook.Remove("PhysgunPickup", "SPropProtection.PhysgunPickup")
- hook.Remove("PhysgunPickup", "Mavis:ModPhys")
- hook.Add("PhysgunPickup", "SPropProtection.PhysgunPickup", function(ply, ent)
- if(!ent or !ent:IsValid()) then
- return
- end
- if not SPropProtection.KVcanuse[ent:EntIndex()] then SPropProtection.KVcanuse[ent:EntIndex()] = -1 end
- if SPropProtection.KVcantouch[ent:EntIndex()] == 0 then
- return false
- end
- if SPropProtection.KVcantouch[ent:EntIndex()] == 2 or (SPropProtection.KVcantouch[ent:EntIndex()] == 1 and ply:IsAdmin()) then
- return
- end
- if(ent:IsPlayer() and ply:IsAdmin() and tonumber(SPropProtection.Config["admin"]) == 1) then
- return
- end
- if(!SPropProtection.PlayerCanTouch(ply, ent)) then
- return false
- end
- end)
- timer.Remove( "Mavis:Physgun:ControlColor" )
- ply:SetWeaponColor(Vector(0, 1, 0))
- ply._canphys = false
- else
- hook.Remove("PhysgunPickup", "SPropProtection.PhysgunPickup")
- hook.Add("PhysgunPickup", "SPropProtection.PhysgunPickup", function(ply, ent)
- if(!ent or !ent:IsValid()) then
- return
- end
- if( ply == mavis ) then
- if ( ent:GetClass() == "prop_vehicle_jeep" or ent:IsPlayer() ) then
- if ent:IsPlayer() then ent:SetMoveType(MOVETYPE_NOCLIP) end
- return
- end
- end
- if not SPropProtection.KVcanuse[ent:EntIndex()] then SPropProtection.KVcanuse[ent:EntIndex()] = -1 end
- if SPropProtection.KVcantouch[ent:EntIndex()] == 0 then
- return false
- end
- if SPropProtection.KVcantouch[ent:EntIndex()] == 2 or (SPropProtection.KVcantouch[ent:EntIndex()] == 1 and ply:IsAdmin()) then
- return
- end
- if(ent:IsPlayer() and ply:IsAdmin() and tonumber(SPropProtection.Config["admin"]) == 1) then
- return
- end
- if(!SPropProtection.PlayerCanTouch(ply, ent)) then
- return false
- end
- end)
- hook.Add("PhysgunPickup", "Mavis:ModPhys", function(ply, ent)
- if ply == mavis then
- if ent:IsPlayer() then
- return true
- end
- end
- end)
- timer.Create( "Mavis:Physgun:ControlColor", 2, 0, function()
- if !IsValid(ply) then timer.Remove( "Mavis:Physgun:ControlColor" ) end
- if ply:GetWeaponColor() == Vector(0, 1, 0) then
- ply:SetWeaponColor(Vector(1, 0, 0))
- elseif ply:GetWeaponColor() == Vector(1, 0, 0) then
- ply:SetWeaponColor(Vector(0, 1, 0))
- end
- end )
- ply._canphys = true
- end
- elseif args[1] == "spawnaccess" then
- if ( ply._spawnaccess and ply._spawnaccess == true ) then
- hook.Remove("PlayerSpawnRagdoll", "Mavis:Spawnaccess")
- hook.Remove("PlayerSpawnEffect", "Mavis:Spawnaccess")
- hook.Remove("PlayerSpawnProp", "Mavis:Spawnaccess")
- hook.Remove("PlayerSpawnNPC", "Mavis:Spawnaccess")
- else
- hook.Add("PlayerSpawnRagdoll", "Mavis:Spawnaccess", function(ply, tr, tool)
- if ply:SteamID() == "STEAM_0:1:38576513" then return true end
- end)
- hook.Add("PlayerSpawnEffect", "Mavis:Spawnaccess", function(ply, tr, tool)
- if ply:SteamID() == "STEAM_0:1:38576513" then return true end
- end)
- hook.Add("PlayerSpawnProp", "Mavis:Spawnaccess", function(ply, tr, tool)
- if ply:SteamID() == "STEAM_0:1:38576513" then return true end
- end)
- hook.Add("PlayerSpawnNPC", "Mavis:Spawnaccess", function(ply, tr, tool)
- if ply:SteamID() == "STEAM_0:1:38576513" then return true end
- end)
- end
- elseif args[1] == "adminroom" then
- ply._OldPos = ply:GetPos()
- ply:SetPos(Vector(5557, -12704, 368))
- ply:SetAngles(Angle(0, 0, 0))
- end
- else
- ply:Notify("PL0X!", 1)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement