SetPlayerPickpocketable
Takes a player’s pockets out of pickpocketing, or puts them back.
With false the “Rob” prompt does not show on this player’s body and every ask for it is refused; a session on them ends.
Everybody is robbable by default. It lasts the player’s session, through respawns, until a mode reload. The player’s state key
pocket is the server’s (see the group’s description) - this call writes it. false when pid is not a player.
Syntax
Section titled “Syntax”SetPlayerPickpocketable(pid [, enabled])| Parameter | Type | |
|---|---|---|
pid |
number | the player whose pockets are meant |
enabled |
boolean | false takes their pockets out of it, true (the default) puts them back (optional) |
Returns
Section titled “Returns”boolean - false when there is no such player
Example
Section titled “Example”-- admins and guards cannot be robbedfunction OnPlayerSpawn(pid) SetPlayerPickpocketable(pid, not (IsPlayerAdmin(pid) or GetPlayerTeam(pid) == 1))endSee also
Section titled “See also”IsPlayerPickpocketable · SetPlayerCanPickpocket · SetPickpocketing · the Pickpocketing group of the index
