Something's wrong here.

[lua]function PP(pl, cmd, arg)
if TimerStatus == 3 then
pl:ChatPrint(“Error: You cannot Add/Remove Buddies while figh”)
return false
else
local PPbool = false
for kee, vee in pairs( player.GetAll() ) do
userid = vee:UserID() … “.00”
if userid == arg[1] then
PPSteamID = vee:SteamID()
PPName = vee:GetName()
end
end
if PPSteamID != nil then
for k, v in ipairs(pl.Buddies) do
if v == PPSteamID then
pl:RemovePP(k)
PPbool = true
pl:SavePP()
pl:ChatPrint(PPName … " has been removed from your Prop-Protections list.")
umsg.Start( “fm_friend_delete”, pl )
umsg.String(PPSteamID)
umsg.End()
end
end
if PPbool == false then
pl:AddPP(PPSteamID)
pl:SavePP()
pl:ChatPrint(PPName … " has been added to your Prop-Protections list.")
umsg.Start( “fm_friend_add”, pl )
umsg.String(PPSteamID)
umsg.End()
end
end
end
PPbool = false
end
concommand.Add( “PP”, PP )[/lua]

I’ve added [lua] if TimerStatus == 3 then
pl:ChatPrint(“Error: You cannot Add/Remove Buddies while figh”)
return false
else[/lua] onto the code at the top to make sure they cant remove/add when the status is at 3 (fight mode) However this seems to create an error on another function somewhere (a think function).

am I being blind and not noticing something really simple?

I’ve also tried

[lua]

function PP(pl, cmd, arg)
if TimerStatus == 3 then
pl:ChatPrint(“Error: You cannot Add/Remove Buddies while figh”)
return false
end
local PPbool = false
for kee, vee in pairs( player.GetAll() ) do
userid = vee:UserID() … “.00”
if userid == arg[1] then
PPSteamID = vee:SteamID()
PPName = vee:GetName()
end
end
if PPSteamID != nil then
for k, v in ipairs(pl.Buddies) do
if v == PPSteamID then
pl:RemovePP(k)
PPbool = true
pl:SavePP()
pl:ChatPrint(PPName … " has been removed from your Prop-Protections list.")
umsg.Start( “fm_friend_delete”, pl )
umsg.String(PPSteamID)
umsg.End()
end
end
if PPbool == false then
pl:AddPP(PPSteamID)
pl:SavePP()
pl:ChatPrint(PPName … " has been added to your Prop-Protections list.")
umsg.Start( “fm_friend_add”, pl )
umsg.String(PPSteamID)
umsg.End()
end
end
PPbool = false
end
concommand.Add( “PP”, PP )
[/lua]

Yet that errors too.

thanks for giving us the error so we can actually help, if there isn’t an error,

where is TimerStatus being declared, inside your first loop userid is being declared as global, on the outside of the loop put

local userid;

PPSteamID and PPName are both global for no reason localise them.

PPBool is global for no reason.

What is that first loop doing exactly you’re basically just recreating a dumb version of the steam id, use UniqueID().

the way you’re writing this doesn’t make any sense sorry.

There is no error, also I didn’t create this gamemode, so I don’t know about the loop.

TimerStatus is declared in another lua file. The function below mine however also uses it

[lua]function GM:PlayerNoClip( pl )
if pl:Team() != TEAM_SPECTATOR then
if TimerStatus == 3 then
pl:ChatPrint(“Only admins can noclip in buildmode!”)
return false
elseif pl:IsAdmin() then
return true
else
pl:ChatPrint(“Only admins can noclip in buildmode!”)
return false
end
end
end
end
[/lua]