Przejdź do głównej zawartości

IsValidObject

Description

Checks if an object with the ID provided exists.

NameDescription
objectidThe ID of the object to check the existence of.

Returns

true - The object exists.

false - The object does not exist.

Examples

new objectid;

public OnGameModeInit()
{
objectid = CreateObject(2587, 2001.195679, 1547.113892, 14.283400, 0.0, 0.0, 96.0);
return 1;
}

public OnGameModeExit()
{
if (IsValidObject(objectid))
{
DestroyObject(objectid);
}
return 1;
}

Notes

warning

This is to check if an object exists, not if a model is valid.