Skip to content

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.

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)

boolean - false when there is no such player

-- admins and guards cannot be robbed
function OnPlayerSpawn(pid)
SetPlayerPickpocketable(pid, not (IsPlayerAdmin(pid) or GetPlayerTeam(pid) == 1))
end

IsPlayerPickpocketable · SetPlayerCanPickpocket · SetPickpocketing · the Pickpocketing group of the index