Hello
When you create teleport and aim at "ceiling", the teleport goes up, and we can't see it.
Look at the picture:
http://img402.**************/img402/9773/teleportlol.jpg
Let's fix it!
First of all, you need to have
#include <fakemeta> in the beginning of the bm.
Next step: change
PHP Code:
new const Float:gfTeleportZOffset = 38.0;
to
PHP Code:
new const Float:gfTeleportZOffset = 16.0;
Next: go to
PHP Code:
createTeleportAiming(const id, const teleportType)
{
//make sure player has access to this command
if (get_user_flags(id) & BM_ADMIN_LEVEL)
{
//get where player is aiming for origin of teleport entity
new pOrigin[3], Float:vOrigin[3];
get_user_origin(id, pOrigin, 3);
IVecFVec(pOrigin, vOrigin);
vOrigin[2] += gfTeleportZOffset;
//create the teleport of the given type
createTeleport(id, teleportType, vOrigin);
}
}
and change it to:
PHP Code:
createTeleportAiming(const id, const teleportType)
{
//make sure player has access to this command
if (get_user_flags(id) & BM_ADMIN_LEVEL)
{
//get where player is aiming for origin of teleport entity
new pOrigin[3], Float:vOrigin[3];
get_user_origin(id, pOrigin, 3);
IVecFVec(pOrigin, vOrigin);
new Float:flCrosshairPitch = get_pdata_float( id, 506 ) // m_flCrosshairPitch = 506;
if(0.0 <= flCrosshairPitch <= 125.0)
{
vOrigin[2] -= gfTeleportZOffset;
}
//create the teleport of the given type
createTeleport(id, teleportType, vOrigin);
}
}
That's all, hope you enjoyed it!