Teleport With Objects -
Mohaowmad - 01.03.2019
Hello
How can teleport with zcmd when i get close to an object like ( Doors / Gates or ....)
Thanks
Re: Teleport With Objects -
Kaliber - 01.03.2019
You can check with
IsPlayerInRangeOfPoint if the player is at the door and then use
SetPlayerPos to teleport the player
Re: Teleport With Objects -
Mohaowmad - 01.03.2019
Tnx Bro
Re: Teleport With Objects -
Mohaowmad - 01.03.2019
Sorry / Another Question

Where Should i Add IsPlayerInRangeOfPoint ?
Re: Teleport With Objects -
JasonRiggs - 01.03.2019
Example:
PHP код:
cmd:enter(playerid, params[])
{
if(!IsPlayerInRangeOfPoint(playerid, 0, 0, 0)) return SendClientMessage(playerid, -1, "You are not near the door!");
SetPlayerPos(playerid, 1, 1, 1);
return 1;
}
Re: Teleport With Objects -
Mohaowmad - 01.03.2019
Tnx 4 Help
But:
This Code
Код HTML:
CMD:enter(playerid, params[])
{
if (IsPlayerInRangeOfPoint(playerid, 7.0, 2410.7625,22.7374,318.7558))
{
SetPlayerPos(playerid, 2617.1079,62.8777,256.7219);
return 1;
}
return 0;
}
when i enter "2410.7625,22.7374,318.7558" position, i enter /ender & nothing will happen
i just want to teleport from "2410.7625,22.7374,318.7558" to "2617.1079,62.8777,256.7219"
Tnx
Re: Teleport With Objects -
Kaliber - 01.03.2019
So why not use the code above?
PHP код:
CMD:enter(playerid, params[])
{
if(!IsPlayerInRangeOfPoint(playerid, 7.0, 2410.7625,22.7374,318.7558)) return SendClientMessage(playerid, -1, "You are not near the door!");
SetPlayerPos(playerid, 2617.1079,62.8777,256.7219);
return 1;
}
You have to type /enter and it should work fine, if you are at the right position!
Re: Teleport With Objects -
Mohaowmad - 01.03.2019
U R The Best

I'm Just Noob in Scripting
Thanks, that Worked
Re: Teleport With Objects -
TheToretto - 01.03.2019
Poor codes shown above. There isn't only one door in your server is it? Loop through all your server's doors, then run the checks needed.
Re: Teleport With Objects -
d3Pedro - 01.03.2019
You can also use
GetDynamicObjectPos
e.g:
pawn Код:
new objectid;
objectid = CreateDynamicObject(....);
CMD:enter(playerid, params[])
{
new Float:x, Float:y, Float:z;
GetDynamicObjectPos(objectid, x, y, z);
if(IsPlayerInRangeOfPoint(playerid, 2.0, x, y, z))
{
SetPlayerPos(...);
}
return 1;
}
Re: Teleport With Objects -
JasonRiggs - 01.03.2019
Quote:
Poor codes shown above. There isn't only one door in your server is it? Loop through all your server's doors, then run the checks needed
|
He asked for something i sent him it, just like that, he wanted a teleport from a POINT to POINT as a result I gave him a code for it, but if he asked for a code for a door's system then i'd send him one, so instead of bumping the thread showing us your skills, read first.
Quote:
You can also use GetDynamicObjectPos
|
That's not even related to the thread.