what isn't good in this code?
#1

Quote:

forward AutoOpen(playerid);
public AutoOpen(playerid)
{
if(IsPlayerConnected(playerid))
{
if(PlayerToPoint(playerid, 2712.89990234, -1073.19995117, 70.30000305))
{
MoveObject(gate,2712.89990234,-1073.19995117,63.30000305,2);
}
else
{
MoveObject(gate,2712.89990234,-1073.19995117,70.30000305,2);
}
}
}

|

What's Bad Here? O_O
Reply
#2

Try replace

pawn Код:
if(PlayerToPoint(playerid, 2712.89990234, -1073.19995117, 70.30000305))
with

pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 2712.89990234, -1073.19995117, 70.30000305))
Reply
#3

Quote:
Originally Posted by Killer#Mummy
Посмотреть сообщение
Try replace

pawn Код:
if(PlayerToPoint(playerid, 2712.89990234, -1073.19995117, 70.30000305))
with

pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 2712.89990234, -1073.19995117, 70.30000305))
No, you forgot the range.


pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 5.0, 2712.89990234, -1073.19995117, 70.30000305))
Now the door will open if you are within the range of 5 from the point.
Reply
#4

its compiled , but now there is no Gate O_O?
Reply
#5

Did you make a gate and assigned it to the variable gate?
Reply
#6

ok , i try the code's,
the first , i didnt saw the gate there,
the second , i say the gate far from the Hq gate.. O_O
Reply
#7

You sure you got the correct coords for the gate to move to?
Reply
#8

code :
forward AutoOpen(playerid);
public AutoOpen(playerid)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, 2712.89990234, -1073.19995117, 70.30000305))
{
MoveObject(gate,2712.89990234,-1073.19995117,63.30000305,2);
}
else
{
MoveObject(gate,2712.89990234,-1073.19995117,70.30000305,2);
}
}
}



The Normal Command:
if(strcmp(cmdtext, "/Open" ,true)==0)
{
MoveObject(gate, 1767.5032,2730.7378,21.9277, 2);
SendClientMessage(playerid, COLOR_WHITE, "дщтш рфъз бдцмзд..");
return 1;
}

if(strcmp(cmdtext, "/Close" ,true)==0)
{
MoveObject(gate, 1766.9000244141, 2730.1000976563, 12.60000038147, 4);
SendClientMessage(playerid, COLOR_WHITE, "дщтш рсвш бдцмзд.");
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)