Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local PLUGIN={} -- Create the plugin table
- PLUGIN.Name="Reload" -- Plugin's name
- PLUGIN.Command="reload"
- PLUGIN.OnFail=function(ply) -- Not automatically called - see OnCall
- ply:ChatPrint("You must be an admin to reload the map!")
- end
- PLUGIN.OnCall=function(ply) -- Called whenever the command is run in console (mr reload) or chat (!reload, /reload)
- if !ply:IsPlayer() or ply:IsAdmin() then -- Check for permission
- RunConsoleCommand("changelevel", game.GetMap()) -- Reload the map
- else
- PLUGIN.OnFail(ply) -- If they don't have permission, call OnFail
- end
- end
- moderari.RegisterPlugin("Reload", PLUGIN) -- Register the plugin with name Reload.
Advertisement
Add Comment
Please, Sign In to add comment