SetPlayerPos error
#1

I freeze the player and i teleportate the player on the coordonate, and he's pos is seen just him, another player see the player in place before teleportating



new Float:X,Float:Y,Float:Z;
TogglePlayerControllable(playerid,0);
GetPlyerPos(playerid,X,Y,Z);
SetPlayerPos(playerid,X,Y+2,Z);

I am freezed, i have the position in X,Y+2 and Z,but any other player see me in X,Y and Z not in X,Y+2,Z
if I unfreeeze he see me in X,Y+2,Z
But why he can't se me in x,y+2,z when I am freezed? and how can i resolve this problem?
Reply
#2

can i see your: public OnPlayerUpdate?
Reply
#3

Try this:
Код:
    new Float:X,Float:Y,Float:Z;
    GetPlyerPos(playerid,X,Y,Z);
    SetPlayerPos(playerid,X,Y+2,Z);
    TogglePlayerControllable(playerid,0);
Reply
#4

I don't have nothing on OnplayerUpdate, is Grandlarp from sa-mp
And I try to freeze player after teleport, and don't work
Reply
#5

try to add:
PHP код:
public OnPlayerUpdate(playerid)
{
if(
TogglePlayerControllable(playerid1)) {
 return 
1;
}
return 
1;

Reply
#6

Quote:
Originally Posted by jlalt
Посмотреть сообщение
try to add:
PHP код:
public OnPlayerUpdate(playerid)
{
if(
TogglePlayerControllable(playerid1)) {
 return 
1;
}
return 
1;

Oh my god.. Why on earth would he need to put this under OnPlayerUpdate? This callback gets called constantly for player.

What if he needs to freeze the player again in other chunk of code? It would cause problem there.
Reply
#7

Quote:
Originally Posted by Sjn
Посмотреть сообщение
Oh my god.. Why on earth would he need to put this under OnPlayerUpdate? This callback gets called constantly for player.
Dude you did not read if( ??!!
if used for e.e?

this say: if(playercontrolable taked) {
return 1; == keep moveing he for players!
Reply
#8

Using an if to check if the function will return true itself is nonsensical - the player calls OnPlayerUpdate so they are obviously connected - it will just constantly return 1 while unfreezing the player constantly.

TogglePlayerControllable doesn't return depending on if they are frozen or not, it returns 1 if the player is connected and 0 otherwise.
Reply
#9

I am totaly freezed, i put 0 and I can't move.
Sorry but don't work.
Reply
#10

So what can I do?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)