Z Position - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Z Position (
/showthread.php?tid=460477)
Z Position -
Skribblez - 28.08.2013
I can't seem to set a player's position under the ground.
Here's my code:
pawn Код:
SetPlayerPos(playerid, 2000.310457, -1451.558857, -1500.0);
Anything wrong with it?
Re: Z Position -
Vince - 28.08.2013
Can't do it. Game mechanics will respawn you if you go below a certain point.
Re: Z Position -
Konstantinos - 28.08.2013
Going under the ground will set your position somewhere close. What do you want to do anyways?
Re: Z Position -
ProjectMan - 28.08.2013
Quote:
Originally Posted by Skribblez
I can't seem to set a player's position under the ground.
Here's my code:
pawn Код:
SetPlayerPos(playerid, 2000.310457, -1451.558857, -1500.0);
Anything wrong with it?
|
Why would you put someone underground? Anyway, you can, if you freeze that player after teleporting them to that position (assuming your code really teleports that player underground):
pawn Код:
TogglePlayerControllable(playerid, 0);
SetPlayerPos(playerid, 2000.310457, -1451.558857, -1500.0);
//Edited.
Re: Z Position -
Konstantinos - 28.08.2013
Quote:
Originally Posted by ProjectMan
Why would you put someone underground? Anyway, you can, if you freeze that player after teleporting them to that position (assuming your code really teleports that player underground):
pawn Код:
TogglePlayerControllable(playerid, 1); SetPlayerPos(playerid, 2000.310457, -1451.558857, -1500.0);
|
0 freezes, 1 unfreezes.
Re: Z Position -
Skribblez - 28.08.2013
Well, I'm coding a hospital system and whenever a player is hospitalized their camera position would be set to the area of the hospital but of course their body shouldn't be seen. I'm pretty sure it worked before.
Any work-around for this? Thanks.
Quote:
Originally Posted by ProjectMan
Why would you put someone underground? Anyway, you can, if you freeze that player after teleporting them to that position (assuming your code really teleports that player underground):
pawn Код:
TogglePlayerControllable(playerid, 1); SetPlayerPos(playerid, 2000.310457, -1451.558857, -1500.0);
|
You mean
TogglePlayerControllable(playerid, 0);?
Re: Z Position -
Kutter - 28.08.2013
ProjectMan is right, you can also set the player's position inside a building somewhere close if the player doesn't fall.
Re: Z Position -
ProjectMan - 28.08.2013
Quote:
Originally Posted by Konstantinos
0 freezes, 1 unfreezes.
|
Quote:
Originally Posted by Skribblez
Well, I'm coding a hospital system and whenever a player is hospitalized their camera position would be set to the area of the hospital but of course their body shouldn't be seen. I'm pretty sure it worked before.
Any work-around for this? Thanks.
You mean TogglePlayerControllable(playerid, 0);?
|
Yes, I do mean that. Sorry. xD
Re: Z Position -
Skribblez - 28.08.2013
Quote:
Originally Posted by Kutter
ProjectMan is right, you can also set the player's position inside a building somewhere close if the player doesn't fall.
|
I've thought of that, but wouldn't it ruin the player's camera position since it has to sync with the player's actual position? I'll give it a shot though.
EDIT: Also, changing the player's virtual world is an option, right?
Re: Z Position -
Skribblez - 28.08.2013
When I changed the player's position to inside a building (different from the camera position), the visual looks blurry.