And can it work with U.S.G.N. IDs so I can put more IDs for more admins?
Thanks!
maPmaKer
Scripts
Lua Scripts/Questions/Help
Colors = { green = "000255000", red = "255000000", blue = "000000255", yellow = "255255000" }
AdminTable = {}
addhook("say","AdminSay")
function NewAdmin(USGN,COLOR)
	AdminTable[USGN] = COLOR
end
function AdminSay(P,T)
	local A = AdminTable[player(P,"usgn")]
	if A then
		msg("©"..Colors[string.lower(A)]..player(P,"name").."(Admin): "..T)
		return(1)
	end
	return(0)
end
NewAdmin(5537,"Red")
Colors = { green = "000255000", red = "255000000", blue = "000000255", yellow = "255255000" }
AdminTable = {}
addhook("say","AdminSay")
function NewAdmin(USGN,COLOR)
	AdminTable[USGN] = COLOR
end
function AdminSay(P,T)
	local A = AdminTable[player(P,"usgn")]
	if A then
		msg("©"..Colors[string.lower(A)]..player(P,"name").."(Admin): "..T)
		return(1)
	end
	return(0)
end
NewAdmin(5537,"Red")
addhook ("say","lat")
function lat(p,t)
if (t == "[^","]+,[^","]+") then -- doesnt work
msg ("Works")
end
end
addhook('hit','weap')
-- Check if the gun is a pistol
function weap(id,sid,w)
if w > 0 and w < 7 then team(id,sid) return 1
else return 0 end
end
-- Check if it's fired by a Terrorist
function team(id,sid)
if player(sid,'team') == 1 then teleport(id)
elseif player(sid,'team') ~= 1 then msg2(sid,"©255000000You can't arrest people!") end
end
-- Teleport the player to a quasi-random location
function teleport(id)
local PLACES = {{1680,80},{2000,80},{2032,528}}
local PLACE = PLACES[math.random(1,#PLACES)]
parse('setpos '..id..' '..PLACE[1]..' '..PLACE[2])
end
addhook ("say","lat")
function lat(p,t)
if (t == "[^","]+,[^","]+") then -- doesnt work
msg ("Works")
end
end
addhook('hit','weap')
-- Check if the gun is a pistol
function weap(id,sid,w)
if w > 0 and w < 7 then team(id,sid) return 1
else return 0 end
end
-- Check if it's fired by a Terrorist
function team(id,sid)
if player(sid,'team') == 2 then teleport(id) --Here team1 = terrorists team2 = counterterrorists
elseif player(sid,'team') ~= 1 then msg2(sid,"©255000000You can't arrest people!") end
end
-- Teleport the player to a quasi-random location
function teleport(id)
local PLACES = {{1680,80},{2000,80},{2032,528}}
local PLACE = PLACES[math.random(1,#PLACES)]
parse('setpos '..id..' '..PLACE[1]..' '..PLACE[2])
end
addhook ("say","lat")
function lat(p,t)
if (t == "[^","]+,[^","]+") then -- doesnt work
msg ("Works")
end
end
Colors = { green = "000255000", red = "255000000", blue = "000000255", yellow = "255255000" }
AdminTable = {}
addhook("say","AdminSay")
function NewAdmin(USGN,COLOR)
	AdminTable[USGN] = COLOR
end
function AdminSay(P,T)
	local A = AdminTable[player(P,"usgn")]
	if A then
		msg("©"..Colors[string.lower(A)]..player(P,"name").."(Admin): "..T)
		return(1)
	end
	return(0)
end
NewAdmin(5537,"Red")
-- Script By Blazzingxx
Colors = { green = "000255000", red = "255000000", blue = "000000255", yellow = "255255000" }
AdminTable = { }
addhook("say","AdminSay")
function NewAdmin(USGN,COLOR,RANK)
	AdminTable[USGN] = { C = COLOR, R = RANK}
	local A = AdminTable[USGN]
end
function AdminSay(P,T)
	local A = AdminTable[player(P,"usgn")]
	if A then
		msg("©"..Colors[string.lower( A.C )]..player(P,"name").." ("..string.upper( A.R ).."): "..T)
		return(1)
	end
	return(0)
end
NewAdmin(5537,"Red","admin")
-- Script By Blazzingxx
addhook("hit","Knockback")
function Knockback(V,S,W)
	if (W > 0 and W < 50) then
		local DMG = (itemtype(W,"dmg") / 2)
		local ROT = math.rad(player(S,"rot") - 90)
		local NX = player(V,"x") + (math.cos(ROT) * DMG)
		local NY = player(V,"y") + (math.sin(ROT) * DMG)
		if tile(NX / 32 - 1,NY / 32 - 1,"walkable") then
			parse(string.format("setpos %s %s %s",V,NX,NY))
		end
	end
end
-- Script By Blazzingxx
addhook("hit","Knockback")
function Knockback(V,S,W)
	if (W > 0 and W < 50) then
		local DMG = (itemtype(W,"dmg") / 2)
		local ROT = math.rad(player(S,"rot") - 90)
		local NX = player(V,"x") + (math.cos(ROT) * DMG)
		local NY = player(V,"y") + (math.sin(ROT) * DMG)
		if tile(NX / 32 - 1,NY / 32 - 1,"walkable") then
			parse(string.format("setpos %s %s %s",V,NX,NY))
		end
	end
end
addhook("say", "buylaser")
function buylaser(id,txt)
	if (txt == "!laser") then
		if (player(id, "money") > 4999) then
			parse("equip "..id.." 45")
			msg2(id, "Bought Laser!")
			parse("setmoney "..id.." "..player(id,"money") - 5000)
		end
	return 1
	end
end