Exemplo n.º 1
0
VEHICLE_CLASS* sq_tovehicle(SQVM* pVM, int idx)
{
	CEntity* pEntity = sq_toentity(pVM, idx);
	if( pEntity && pEntity->GetType() == ENTITY_TYPE_VEHICLE )
		return dynamic_cast< VEHICLE_CLASS* >( pEntity );
	return NULL;
}
Exemplo n.º 2
0
CTimer* sq_totimer(SQVM* pVM, int idx)
{
	CEntity* pEntity = sq_toentity(pVM, idx);
	if( pEntity && pEntity->GetType() == ENTITY_TYPE_TIMER )
		return dynamic_cast< CTimer* >( pEntity );
	return NULL;
}
Exemplo n.º 3
0
PLAYER_CLASS* sq_toplayer(SQVM* pVM, int idx)
{
	CEntity* pEntity = sq_toentity(pVM, idx);
	if( pEntity && pEntity->GetType() == ENTITY_TYPE_PLAYER )
		return dynamic_cast< PLAYER_CLASS* >( pEntity );
	return NULL;
}
Exemplo n.º 4
0
CResource* sq_toresource(SQVM* pVM, int idx)
{
	CEntity* pEntity = sq_toentity(pVM, idx);
	if( pEntity && pEntity->GetType() == ENTITY_TYPE_RESOURCE )
		return dynamic_cast< CResource* >( pEntity );
	return NULL;
}
Exemplo n.º 5
0
int CEntityNatives::Delete(SQVM* pVM)
{
	CEntity* pEntity = sq_toentity(pVM, 2);
	if(pEntity)
	{
		switch( pEntity->GetType() )
		{
			case ENTITY_TYPE_CUSTOM:
				delete pEntity;
				sq_pushbool(pVM,true);
				break;
			default:
				sq_pushbool(pVM,false);
		}
	}
	else
		sq_pushbool(pVM,false);
	return 1;
}