Command helpers¶
Helpers that build and check command text, so api.ban("user", "RDM", "7d") sends
ban user RDM 7d.
Every helper checks its arguments before anything is sent (a bad duration or team raises
ValueError straight away) and, by default, raises :class:~oxrpy.CommandFailedError if the
server says the command didn't work. Pass check=False to get the result back instead.
With :class:~oxrpy.AsyncOxfordAPI every helper returns a coroutine: await api.kick(...).
CommandHelpers ¶
Mixed into the clients. Each method sends one command with :meth:run_command.
kick ¶
Move someone out of your server, showing the reason. Staff can't be kicked.
ban ¶
Ban someone, in the server or not. duration is "30m", "12h", "7d",
"1d12h", a timedelta or seconds; leave it out for a permanent ban.
Reasons can be up to 200 characters.
jail ¶
Jail someone as an arrest would, for 10 to 3,600 seconds (or the usual sentence).
wanted ¶
Set a wanted level from 0 to 3. players can be a name, all, team:Civilian…
pm ¶
Send a private message, shown with your server's name and logo.
resolve_modcall ¶
Mark a mod call (help request) as handled. The CaseId is in ModCalls.
rank ¶
Put someone on the staff with a rank (its name or Id, e.g. "Admin"), or change it.
group_add ¶
Add someone to one of your groups (AdvancedServer).
group_remove ¶
Take someone out of one of your groups (AdvancedServer).
set_team ¶
Put someone on a team, ignoring team limits and locks.
teleport ¶
Teleport them next to another player (the tp command).
teleport_to_vehicle ¶
Teleport them next to another player's vehicle (the tocar command).
set_invincible ¶
Make them unable to be hurt by weapons (or able to again), until they leave.
give ¶
Give a RoleplayKit tool: megaphone, firestarter, lectern, flag or staffcuffs.
despawn_vehicle ¶
Put someone's vehicle away (the despawn command).
remove_vehicle ¶
Remove a vehicle by registration ("RJ75 FLK") or by its owner.
spawn_vehicle ¶
Spawn one of your FleetKit custom vehicles in front of them.
lock_time ¶
Stop the clock (or start it again with locked=False).
lock_weather ¶
Stop the weather changing by itself (or let it again with locked=False).
alert ¶
An alert to everyone, style "normal", "yellow" or "red".
set_message ¶
Pin a message on everyone's screen until it's removed.
speed_limit ¶
Limit every vehicle to 5-200 MPH (RoleplayKit). None or 0 lifts it.
create_incident ¶
Open a control-room incident at x, z (studs) for an emergency team, priority 1-3.
The new incident's ID is in the result's Message.
start_callout ¶
Start a Fire or Highways callout by its key (RoleplayKit; list_callouts shows keys).
ambulance_callout ¶
A patient callout for that paramedic, or the first one free (RoleplayKit).
list_callouts ¶
The callouts you can start, with their keys, in the result's Message.
set_setting ¶
Change a Server Management setting. value is sent as JSON, so pass Python values:
api.set_setting("TeamLimits", {"Police": 8}). Lists and objects replace the whole value.
new_join_code ¶
Replace the join code with a new random one. The new code is in Message.
clear_placeables ¶
Pick up one person's cones, signs and other placed items, or everyone's.
format_duration ¶
Turn "7d", "1d12h", timedelta(hours=12) or a number of seconds into the
ban command's duration. None or "permanent" gives "permanent".