Manual:DIL Manual/paycheck()
paycheck()
Function (integer). Tells whether a player's account allows them into the zone of a unit.
paycheck(pc : unitptr, place : unitptr)
For servers that charge for play (accounting on in server.cfg). A zone can be
marked pay-only with its payonly value; this checks that value for
the zone place belongs to against the player's account. Use it before moving a
player somewhere, as the movement code in skills.zon does with the room an exit leads to.
Parameters
| Name | Type | Meaning |
|---|---|---|
| pc | unitptr | The character to check. Must be a character. |
| place | unitptr | A unit of the zone to check, usually the room the player is going to. |
Returns
Integer: TRUE when the player may go there, FALSE when not. When it
says no, the player has already been sent the server's pay message.
TRUE always when accounting is off (most servers), and for non-players, gods,
players connected from the local network and zones that aren't pay-only. A zone's
payonly 1 needs credit on the account, 2 a flat rate that hasn't run out, and 3 is
for players who have neither.
It fails when pc is null or not a character, or place is null; with
accounting off it gives TRUE without looking at the arguments.
Notes
- The player comes first. The old manual had the arguments the other way round.
- The zone is the one
placewas defined in, not the zone it is in now: pass a
room, not an object or a character who may have walked elsewhere.
Example
dilbegin go_to(pc : unitptr, room : unitptr);
code
{
if (not paycheck(pc, room))
{
act("You don't have access to that location.", A_ALWAYS, pc, null, null, TO_CHAR);
quit;
}
link(pc, room);
quit;
}
dilend
Moves a player to a room only if their account allows it, as the movement code in skills.zon does.