• GM:CanTool() Problems!
    3 replies, posted
[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)
[QUOTE=GoatR;16268608][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)[/QUOTE] function GM:CanTool(ply, [B]mode[/B]) if [B]toolmode[/B] == "turret" or [B]toolmode[/B] == "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.
Sorry, you need to Log In to post a reply to this thread.