Esc to clear, Enter to open the best match, click an export to open it in its page
Get Started
The calls you'll use
WHIP has about 650 exports, but a job, a shop or a mission uses about twenty. These are the ones WHIP's own resources call most. Search (/) finds the rest.
| To | Call | Side |
|---|---|---|
Declare (in Whip.register) | ||
| Make an item, and what using it does | RegisterItem, RegisterUseHandler | Server |
| Accept a message from a player's game, checked | SecureEvent | Server |
| Answer a question from a player's game, checked | SecureCallback; ask it with Callback | Server; client |
| A prompt, a wheel option, a choice on a car part | AddAction | Client |
| A job, a stash, a shop that always exist | EnsureJob, EnsureContainer, EnsureShop | Server |
| Players | ||
| Who is this (name, charId, job, session) | GetPlayer | Server |
| Tell them something | NotifyPlayer; on the client Notify | Server; client |
| Remember something about a character | SetPlayerFlag, GetPlayerFlag | Server |
| Still the same character after a wait? | IsSessionCurrent | Server |
| Money | ||
| Charge, and refund if what they paid for fails | ChargePlayer, RefundPlayer | Server |
| Pay them: a wage, a reward | PayPlayer | Server |
| Items | ||
| Give and take | AddItem, RemoveItem | Server |
| Do they have it, how many | HasItem, GetItemCount | Server |
| Change one item (rounds, wear, a serial) | SetItemMetadata | Server |
| Move items between any two places | StoreMove | Server |
| Jobs | ||
| On duty? Allowed to? | IsPlayerClockedOn, HasJobPermission | Server |
| The world | ||
| A car for a job or a rental; read any car | SpawnTempVehicle, GetVehicle | Server |
| A blip, a waypoint | ShowBlip | Server |
| Timed and skilled | ||
| A bar the server times; a skill check | Progress, SkillCheck | Either |
How WHIP talks to your resource#
| You want to | Use | Example |
|---|---|---|
| Hear that something happened | An event: AddEventHandler('whip_core:…', fn). After the fact; it can't be stopped. On the server any resource can fire one, so check GetInvokingResource() where it matters (Server Events) | whip_core:player:loaded |
| Hear a value change | A listener: OnStatChanged, OnVehicleStatChanged, WatchVehicleStat. Only WHIP calls it, and it's removed when your resource stops | A HUD that follows hunger |
| Act just before WHIP does something on the player's game | A client hook: RegisterClientHook. WHIP waits for it (up to a second) but it can't refuse | Put the phone away before a gun is drawn |
| Refuse something of your own | A check you pass in: canUse, canInteract, a panel's onValidate | No drinking in a car |
| Add something to WHIP | Register…, Add…, Ensure…, in Whip.register | RegisterItem, AddAction |