GM:CanTool() Problems!

[lua]
function GM:CanTool(ply, mode)
if toolmode == “turret” or toolmode == “wire_turret” then
if ply:IsAdmin() then
return true
else
ply:PrintMessage(HUD_PRINTCENTER,“Only Admins can spawn turrets!”)
return false
end
else
return true
end
end
[/lua]
Can someone tell me why both admins and players can spawn turrets? It’s supposed to only let admins spawn turrets! (angryface)

function GM:CanTool(ply, mode)
if toolmode == “turret” or toolmode == “wire_turret” then

[lua]
function UseTool( pl, tr, toolmode )
if toolmode == “turret” or toolmode == “wire_turret” then
if pl:IsAdmin() then
return true
else
pl:PrintMessage(HUD_PRINTCENTER,“Only Admins can spawn turrets!”)
return false
end
end
end
hook.Add( “CanTool”, “UseTool”, UseTool );
[/lua]
Remade, works now!

Mode should be toolmode.

[editline]04:37PM[/editline]

Damn it, double ninja.