i have a entity.net.id and a sleeping players player.userID i need a way to check if they exist befor i make a call what is the easest way everything i see for examples on old oxide are no longer in use.
Checking if entity exists with net.id?
What type of entity are you checking for the existance of?
The most generic way to find a networkable is using the global BaseNetworkable.EntityRealm
var networkable = BaseNetworkable.serverEntities.Find(entityNetID);
var entity = networkable as BaseEntity;
if(entity != null) {
Puts("entity found");
} The hotairbaloon on ent kill i need it to check if its the baloon in the net.id i have saved.
i have a sleeping player steam id and a entity.net.ID and i need to do somthing if eather one die
Merged post
Porblem im having now is i need to also check if the sleeping player is still alive with his steam id when the entitys destroyed.
i have a sleeping player steam id and a entity.net.ID and i need to do somthing if eather one die
Merged post
Porblem im having now is i need to also check if the sleeping player is still alive with his steam id when the entitys destroyed.
void EventCheckerBaloon(BaseCombatEntity victimEntity)
{
var entityNetID = pcdData1.EventData[123456].BloonNetID;
var networkable = BaseNetworkable.serverEntities.Find(entityNetID);
var entity = networkable as BaseEntity;
if(entity != null && victimEntity.GetType().ToString() == "HotAirBalloon")
{
if (entity.net.ID == entityNetID)
Puts("entity Died");
}
} BasePlayer player = BasePlayer.Find(steamID);
if(player != null && player.IsSleeping()) {
Puts("Do stuff");
}
Also you don't need to use GetType to check the victimEntity type
if(victimEntity is HotAirBalloon)
{
Puts("is hot air balloon");
} ok thanks that helped alot