Guys i've made an teleport system by using inpoly it works well on localhost but it seems does'nt working well on VPS donno its happening cause of pings or my code
Here is the full system
Main.nut // i am returning false when they step again InPoly, onPlayerPart, onPlayerDeath, onPlayerKill
class PlayerStats
{
frombank = false;
}
function onPlayerMove( player, lastX, lastY, lastZ, newX, newY, newZ )
{
isbank(player);
}
Here is function of isbank
function isbank(player)
{
if(InPoly(player.Pos.x, player.Pos.y, -939.308, -352.559, -939.308, -350.304, -937.33, -352.558, -937.143, -350.229 ))
{
if ( status[player.ID].frombank == true )
{
player.Pos = Vector( -933.531, -351.39, 17.8038 ); // From bank locker
status[player.ID].frombank = false;
}
else
{
player.Pos = Vector( -933.277, -351.746, 7.22692 ); // To bank locker
status[player.ID].frombank = true;
}
}
}
The problem is when i step on my InPoly ( only in vps ) then it teleports me to bank locker then its instantly again teleport me back to Where i was Mean Near of Bank Locker Lift
I wrote this topic in hurry cause my laptop bettery gonna be dead
Using a Timer would be way better.
status[player.ID].frombank = false;
Remove it.
Quote from: rObInX on Mar 11, 2015, 10:07 AMUsing a Timer would be way better.
status[player.ID].frombank = false;
Remove it.
Now i've chage it to this
onScriptLoad()
{
NewTimer( "Check", 2000, 0 );
}
function Check()
{
for ( local i = 0; i < GetMaxPlayers(); i++ )
{
local player = FindPlayer( i );
if (player)
{
if(InPoly(player.Pos.x, player.Pos.y, -939.308, -352.559, -939.308, -350.304, -937.33, -352.558, -937.143, -350.229 ))
{
if ( status[player.ID].frombank == true )
{
player.Pos = Vector( -933.531, -351.39, 17.8038 ); // From bank locker
status[player.ID].frombank = false;
}
else
{
player.Pos = Vector( -933.277, -351.746, 7.22692 ); // To bank locker
status[player.ID].frombank = true;
}
}
}
}
And
status[player.ID].frombank = false;
Is necessary because bank lift has same poly
Just use a pickup for teleportation..
Quote from: Doom_Killer on Mar 11, 2015, 11:24 AMJust use a pickup for teleportation..
Yea but its little bit annoy, Is there any way to add this ???
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fi57.tinypic.com%2F20jhk6s.jpg&hash=d72fbd01a1cc979582cd96641266942c07b06b65)
it looks better than a pickup
Yep, you can simulate that pink sphere, via custom objects.
(like I simulated the checkpoints in eXtreme Servers)
Quote from: sseebbyy on Mar 11, 2015, 12:50 PMYep, you can simulate that pink sphere, via custom objects.
(like I simulated the checkpoints in eXtreme Servers)
Maybe you should create a video on it, i mean i know you have one on custom objects but instead on how to add that sphere thingy using custom object..
Quote from: Doom_Killer on Mar 11, 2015, 03:58 PMQuote from: sseebbyy on Mar 11, 2015, 12:50 PMYep, you can simulate that pink sphere, via custom objects.
(like I simulated the checkpoints in eXtreme Servers)
Maybe you should create a video on it, i mean i know you have one on custom objects but instead on how to add that sphere thingy using custom object..
It's exactly the same, just a different object.
Quote from: Thijn on Mar 11, 2015, 05:10 PMQuote from: Doom_Killer on Mar 11, 2015, 03:58 PMQuote from: sseebbyy on Mar 11, 2015, 12:50 PMYep, you can simulate that pink sphere, via custom objects.
(like I simulated the checkpoints in eXtreme Servers)
Maybe you should create a video on it, i mean i know you have one on custom objects but instead on how to add that sphere thingy using custom object..
It's exactly the same, just a different object.
And to be honest i didn't understand any of those tutorials except the sprite one.
Quote from: Doom_Killer on Mar 12, 2015, 03:44 AMQuote from: Thijn on Mar 11, 2015, 05:10 PMQuote from: Doom_Killer on Mar 11, 2015, 03:58 PMQuote from: sseebbyy on Mar 11, 2015, 12:50 PMYep, you can simulate that pink sphere, via custom objects.
(like I simulated the checkpoints in eXtreme Servers)
Maybe you should create a video on it, i mean i know you have one on custom objects but instead on how to add that sphere thingy using custom object..
It's exactly the same, just a different object.
And to be honest i didn't understand any of those tutorials except the sprite one.
The tutorials are pretty clear. If you didn't understand it then there's no point in making a new one because you wont understand that one either then :P
Well for my own server i am using pickups but how can i set pickup.Alpha in server.conf ???
Well, it would be better if you would use CreatePickup instead, but I believe there is still a chance to get the pickup instance by using FindPickup( ID )