SetPlayerPos error -
zeth98 - 02.09.2015
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?
Re: SetPlayerPos error -
jlalt - 02.09.2015
can i see your: public OnPlayerUpdate?
Re: SetPlayerPos error -
Variable™ - 02.09.2015
Try this:
Код:
new Float:X,Float:Y,Float:Z;
GetPlyerPos(playerid,X,Y,Z);
SetPlayerPos(playerid,X,Y+2,Z);
TogglePlayerControllable(playerid,0);
Re: SetPlayerPos error -
zeth98 - 02.09.2015
I don't have nothing on OnplayerUpdate, is Grandlarp from sa-mp
And I try to freeze player after teleport, and don't work
Re: SetPlayerPos error -
jlalt - 02.09.2015
try to add:
PHP код:
public OnPlayerUpdate(playerid)
{
if(TogglePlayerControllable(playerid, 1)) {
return 1;
}
return 1;
}
Re: SetPlayerPos error -
Sjn - 02.09.2015
Quote:
Originally Posted by jlalt
try to add:
PHP код:
public OnPlayerUpdate(playerid)
{
if(TogglePlayerControllable(playerid, 1)) {
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.
Re: SetPlayerPos error -
jlalt - 02.09.2015
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!
Re: SetPlayerPos error -
Abagail - 02.09.2015
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.
Re: SetPlayerPos error -
zeth98 - 02.09.2015
I am totaly freezed, i put 0 and I can't move.
Sorry but don't work.
Re: SetPlayerPos error -
zeth98 - 03.09.2015
So what can I do?