Skip to content

WashPlayer

Washes a player with the game’s own wash - every dirt and blood value to 0.

The wash of a bathhouse or a water trough, in the player’s game: "all" (the default) the skin and every piece worn, "skin" the skin alone, "clothes" every piece worn. One item (a class GUID or a name) is washed through SetPlayerDirt and SetPlayerBlood. The mode decides what a wash costs and where it is offered.

WashPlayer(pid [, part])
Parameter Type
pid number the player
part string "all", "skin", "clothes", or an item’s class GUID or name (optional)

boolean | false, string - as SetPlayerDirt’s

-- the bathhouse: 10 groschen for a bath and a wash of the clothes
function OnPlayerCommandText(pid, text)
if text ~= "/bath" then return false end
if GetPlayerMoney(pid) < 10 then
SendClientMessage(pid, COLOR_RED, "A bath is 10 groschen.")
elseif WashPlayer(pid) then
GivePlayerMoney(pid, -10)
SendClientMessage(pid, COLOR_GOLD, "You feel like a new man.")
end
return true
end

SetPlayerDirt · SetPlayerBlood · GetPlayerDirt · the Dirt and blood group of the index