Here's an example.
Code:
#include <engine>
new Float:g_vecLocation[3];
public fnSaveLocation(iClient)
{
// Let's save Client's location to g_vecLocation
entity_get_vector(iClient, EV_VEC_origin, g_vecLocation);
// g_vecLocation now holds the origin of Client
}
public fnSpawnAndTeleport()
{
// Let's create and spawn the Entity
new iEntity = create_entity("whatever_classname");
DispatchSpawn(iEntity);
// We can also check if created Entity is valid
if (!is_valid_ent(iEntity))
return;
// Now we can teleport the Entity to the location
// that is saved in g_vecLocation
entity_set_origin(iEntity, g_vecLocation);
// Done
}
__________________