Hi. this hook works fine without any permissions attached to it however i want to get the BasePlayer value of the player who is moving the item and check their permission before calling any functions can someone help? (also would it be better to use CanMoveItem Hook?)
void OnItemRemovedFromContainer(ItemContainer container, Item item)
{
try
{
if (permission.UserHasPermission(player.UserIDString, "policeprot.use"/*"thepolice.cop"*/))
{
return;
}
else
{
//PoliceHatDetect(item, player);
//PoliceHoodieDetect(item, player);
//PolicePantsDetect(item, player);
//PoliceBootsDetect(item, player);
//PoliceShirtDetect(item, player);
//PoliceSjacketDetect(item, player);
RemoveFace(item);
RemoveChest(item);
}
}
catch (Exception e)
{
PrintError("Error caught! Hook: CanWearItem! Message: \n" + e);
}
}