A question
#1

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?
Reply
#2

Maybe new FLOAT:Z then Getplayerpos(playerid,Z); ? never tryed it EDIT:Guess its more hard then that
Reply
#3

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!
Reply
#4

U guys think GetPlayerPos(playerid,0,0,Z);
should work?
Reply
#5

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
Reply
#6

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?
Reply
#7

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)
Reply
#8

no but if u use my script you can put x and y to 0 and use only blabla[playerid][ZPos] variable
Reply
#9

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?
Reply
#10

Try what gigi1223said...

I hope that will work..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)