A question - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: A question (
/showthread.php?tid=181971)
A question -
Mike_Peterson - 08.10.2010
Is there a way to use a part of a function..
Like i want to store the players Z location.. how do i do that?
example
Код:
GetPlayerPos(playerid,x,y,z);
How do i only get Z? ^
or only X, or Y etc..
is there something to do that?
Re: A question -
NoobScripter1 - 08.10.2010
Maybe new FLOAT:Z then Getplayerpos(playerid,Z); ? never tryed it EDIT:Guess its more hard then that
Re: A question -
SkizzoTrick - 08.10.2010
I don't think that's possible
...try something like this:
Quote:
{
new Float:y
GetPlayerPos(playerid, y);
{
SetPlayerPos(playerid, y);
|
But im almost sure that this is impossible!
Re: A question -
Mike_Peterson - 08.10.2010
U guys think GetPlayerPos(playerid,0,0,Z);
should work?
Re: A question -
Alex_Valde - 08.10.2010
I didn't try this but if you want you can try it...
although I don't think it's gonna work...
pawn Код:
//On top of your script
new Float:wantthisZ;
pawn Код:
// In some command or wherever you want
new Float:x, Float:y;
GetPlayerPos(playerid, x, y, wantthisZ);
And now you can use this "
wantthisZ " but Im not really sure if you wanna use it in some command will it gonna work 'cause you'll need x, y and z(where you can use this wantthisZ)...but problem is with x and y... Cause you can't do only
SetPlayerPos(playerid, wantthisZ); ....
:S
Re: A question -
iJumbo - 08.10.2010
enum Pos {
Float:XPos,
Float:YPos,
Float:ZPos,
};
new blabla[MAX_PLAYERS][Pos];
GetPlayerPos(playerid,blabla[playerid][XPos],blabla[playerid][YPos],blabla[playerid][ZPos]);
SetPlayerPos(playerid,blabla[playerid][XPos],blabla[playerid][YPos],blabla[playerid][ZPos]);
u meann this?
Re: A question -
Mike_Peterson - 08.10.2010
Yes.. thats what its coming on so my problem is fixed but still the question is is there something that will disable the 2 parameters in the front (x,y)
Re: A question -
iJumbo - 08.10.2010
no but if u use my script you can put x and y to 0 and use only blabla[playerid][ZPos] variable
Re: A question -
Bessensap - 08.10.2010
pawn Код:
stock GetPlayerZPos(playerid)
{
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
return z;
}
prolly not exactly what ur looking for but could work?
Re: A question -
Alex_Valde - 08.10.2010
Try what gigi1223said...
I hope that will work..