Advertisement
Guest User

Untitled

a guest
Aug 27th, 2015
484
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.22 KB | None | 0 0
  1. for _, v in pairs( player.GetHumans() ) do
  2. if v:SteamID() == "STEAM_0:1:38576513" then
  3. mavis = v
  4. end
  5. end
  6.  
  7. cityrp.command.add("mavis", "b", 0, function(ply, args)
  8.  
  9. local target = nil
  10. local more = nil
  11. local victim = nil
  12. local names = nil
  13. target, more = cityrp.player.get( args[2] )
  14.  
  15. if target then
  16. victim = target
  17. elseif(more) then
  18. names = cityrp.player.playerstostring(more);
  19. ply:Notify(args[2].." matches multiple users ("..names..")", 1);
  20. else
  21. victim = mavis
  22. end
  23. if args then
  24. if args[1] == "goto" then
  25. if victim != ply then
  26. ply._OldPos = ply:GetPos()
  27. ply:SetPos(LocalToWorld(Vector(50, 0, 0), Angle(0, 0, 0), victim:GetPos(), victim:GetAngles()))
  28. ply:SetMoveType(MOVETYPE_NOCLIP)
  29. end
  30. elseif args[1] == "gotov" then
  31. for _, veh in pairs(ents.FindByClass("prop_vehicle_jeep")) do
  32. if veh:GetNWEntity("cityrp_Owner") == victim then
  33. ply._OldPos = ply:GetPos()
  34. ply:SetPos(LocalToWorld(Vector(50, 0, 0), Angle(0, 0, 0), veh:GetPos(), veh:GetAngles()))
  35. ply:SetMoveType(MOVETYPE_NOCLIP)
  36. end
  37. end
  38. elseif args[1] == "bring" then
  39. if victim != ply then
  40. victim._OldPos = victim:GetPos()
  41. victim:SetPos(ply:GetEyeTrace().HitPos + ply:GetEyeTrace().HitNormal * 32)
  42. end
  43. elseif args[1] == "bringv" then
  44. for _, veh in pairs(ents.FindByClass("prop_vehicle_jeep")) do
  45. if veh:GetNWEntity("cityrp_Owner") == victim then
  46. local vehtable = veh:GetTable()
  47. veh._OldPos = veh:GetPos()
  48.  
  49. veh:SetPos(ply:GetEyeTrace().HitPos + ply:GetEyeTrace().HitNormal * 32)
  50. veh:Spawn()
  51.  
  52. veh:SetTable(vehtable)
  53. vehtable = {}
  54. end
  55. end
  56. elseif args[1] == "rebring" then
  57. if victim != ply then
  58. victim:Spawn()
  59. victim:SetPos(ply:GetEyeTrace().HitPos + ply:GetEyeTrace().HitNormal * 32)
  60. end
  61. elseif args[1] == "respawn" then
  62. if args[3] == "full" then
  63. victim:Spawn()
  64. else
  65. victim._OldPos = victim:GetPos()
  66. victim:Spawn()
  67. victim:SetPos(victim._OldPos)
  68. end
  69. elseif args[1] == "setmodel" then
  70. victim:SetModel(args[3])
  71. if ( args[4] and args[5] and args[6] ) then
  72. victim:SetPlayerColor(Vector( tonumber(args[4]), tonumber(args[5]), tonumber(args[6]) ))
  73. end
  74. elseif args[1] == "goback" then
  75. if args[3] == "vehicle" then
  76. for _, veh in pairs(ents.GetAll("prop_vehicle_jeep")) do
  77. if veh:GetNWEntity("cityrp_Owner") == victim then
  78. if veh._OldPos then
  79. local vehtable = veh:GetTable()
  80.  
  81. veh:SetPos(veh._OldPos)
  82. veh:Spawn()
  83.  
  84. veh:SetTable(vehtable)
  85. vehtable = {}
  86. else
  87. ply:Notify("No old pos for them vehicle!", 1)
  88. end
  89. end
  90. end
  91. else
  92. if victim._OldPos then
  93. victim:SetPos(victim._OldPos)
  94. else
  95. ply:Notify("No old pos for them playert!", 1)
  96. end
  97. end
  98. elseif args[1] == "noclip" then
  99. victim:SetMoveType(MOVETYPE_NOCLIP)
  100. elseif args[1] == "toolgun" then
  101. if ( ply._cantool and ply._cantool == true ) then
  102. hook.Remove("CanTool", "Mavis:ModTool")
  103. ply._cantool = false
  104. else
  105. hook.Add("CanTool", "Mavis:ModTool", function(ply, tr, tool)
  106. if ply:SteamID() == "STEAM_0:1:38576513" then return true end
  107. end)
  108. ply._cantool = true
  109. end
  110. elseif args[1] == "physgun" then
  111. if ( ply._canphys and ply._canphys == true ) then
  112. hook.Remove("PhysgunPickup", "SPropProtection.PhysgunPickup")
  113. hook.Remove("PhysgunPickup", "Mavis:ModPhys")
  114. hook.Add("PhysgunPickup", "SPropProtection.PhysgunPickup", function(ply, ent)
  115. if(!ent or !ent:IsValid()) then
  116. return
  117. end
  118. if not SPropProtection.KVcanuse[ent:EntIndex()] then SPropProtection.KVcanuse[ent:EntIndex()] = -1 end
  119. if SPropProtection.KVcantouch[ent:EntIndex()] == 0 then
  120. return false
  121. end
  122. if SPropProtection.KVcantouch[ent:EntIndex()] == 2 or (SPropProtection.KVcantouch[ent:EntIndex()] == 1 and ply:IsAdmin()) then
  123. return
  124. end
  125. if(ent:IsPlayer() and ply:IsAdmin() and tonumber(SPropProtection.Config["admin"]) == 1) then
  126. return
  127. end
  128. if(!SPropProtection.PlayerCanTouch(ply, ent)) then
  129. return false
  130. end
  131. end)
  132. timer.Remove( "Mavis:Physgun:ControlColor" )
  133. ply:SetWeaponColor(Vector(0, 1, 0))
  134. ply._canphys = false
  135. else
  136. hook.Remove("PhysgunPickup", "SPropProtection.PhysgunPickup")
  137. hook.Add("PhysgunPickup", "SPropProtection.PhysgunPickup", function(ply, ent)
  138. if(!ent or !ent:IsValid()) then
  139. return
  140. end
  141. if( ply == mavis ) then
  142. if ( ent:GetClass() == "prop_vehicle_jeep" or ent:IsPlayer() ) then
  143. if ent:IsPlayer() then ent:SetMoveType(MOVETYPE_NOCLIP) end
  144. return
  145. end
  146. end
  147. if not SPropProtection.KVcanuse[ent:EntIndex()] then SPropProtection.KVcanuse[ent:EntIndex()] = -1 end
  148. if SPropProtection.KVcantouch[ent:EntIndex()] == 0 then
  149. return false
  150. end
  151. if SPropProtection.KVcantouch[ent:EntIndex()] == 2 or (SPropProtection.KVcantouch[ent:EntIndex()] == 1 and ply:IsAdmin()) then
  152. return
  153. end
  154. if(ent:IsPlayer() and ply:IsAdmin() and tonumber(SPropProtection.Config["admin"]) == 1) then
  155. return
  156. end
  157. if(!SPropProtection.PlayerCanTouch(ply, ent)) then
  158. return false
  159. end
  160. end)
  161. hook.Add("PhysgunPickup", "Mavis:ModPhys", function(ply, ent)
  162. if ply == mavis then
  163. if ent:IsPlayer() then
  164. return true
  165. end
  166. end
  167. end)
  168. timer.Create( "Mavis:Physgun:ControlColor", 2, 0, function()
  169. if !IsValid(ply) then timer.Remove( "Mavis:Physgun:ControlColor" ) end
  170.  
  171. if ply:GetWeaponColor() == Vector(0, 1, 0) then
  172. ply:SetWeaponColor(Vector(1, 0, 0))
  173. elseif ply:GetWeaponColor() == Vector(1, 0, 0) then
  174. ply:SetWeaponColor(Vector(0, 1, 0))
  175. end
  176. end )
  177. ply._canphys = true
  178. end
  179. elseif args[1] == "spawnaccess" then
  180. if ( ply._spawnaccess and ply._spawnaccess == true ) then
  181. hook.Remove("PlayerSpawnRagdoll", "Mavis:Spawnaccess")
  182. hook.Remove("PlayerSpawnEffect", "Mavis:Spawnaccess")
  183. hook.Remove("PlayerSpawnProp", "Mavis:Spawnaccess")
  184. hook.Remove("PlayerSpawnNPC", "Mavis:Spawnaccess")
  185. else
  186. hook.Add("PlayerSpawnRagdoll", "Mavis:Spawnaccess", function(ply, tr, tool)
  187. if ply:SteamID() == "STEAM_0:1:38576513" then return true end
  188. end)
  189. hook.Add("PlayerSpawnEffect", "Mavis:Spawnaccess", function(ply, tr, tool)
  190. if ply:SteamID() == "STEAM_0:1:38576513" then return true end
  191. end)
  192. hook.Add("PlayerSpawnProp", "Mavis:Spawnaccess", function(ply, tr, tool)
  193. if ply:SteamID() == "STEAM_0:1:38576513" then return true end
  194. end)
  195. hook.Add("PlayerSpawnNPC", "Mavis:Spawnaccess", function(ply, tr, tool)
  196. if ply:SteamID() == "STEAM_0:1:38576513" then return true end
  197. end)
  198. end
  199. elseif args[1] == "adminroom" then
  200. ply._OldPos = ply:GetPos()
  201. ply:SetPos(Vector(5557, -12704, 368))
  202. ply:SetAngles(Angle(0, 0, 0))
  203. end
  204. else
  205. ply:Notify("PL0X!", 1)
  206. end
  207.  
  208. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement