[Help] Floats -
Tika Spic - 29.02.2012
Ok so I made a Filterscript witch allows me to create/remove objects ingame, so it's like an 'INGAME MAP EDITOR' but the problem is, when i try to make a command to move the objects nothing happens ... i made it like this (just an example):
Код:
if(strcmp(cmd, "/moveleft", true) == 0)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
MoveObject(Object[PlayerMovingObject[playerid]], x, y, z, 9999, 0.0, 0.0, 0.0);
y = y+1;
return 1;
}
and i made a command to asign
and
Код:
Object // when making objects
So it moves the object to my position.. but when i type the command in again it doesn't move, so i guess the problem is:
Can anyone help me?
I tryed making a new Float (example: new Float:ObjectY) and defining ObjectY = y+1 but still nothing...
Please help!
Re: [Help] Floats -
FuTuяe - 29.02.2012
pawn Код:
if(strcmp(cmd, "/moveleft", true) == 0)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
MoveObject(Object[PlayerMovingObject[playerid]], x, y + 1, z, 9999, 0.0, 0.0, 0.0);
y = y+1;
return 1;
}
Re: [Help] Floats -
TheArcher - 29.02.2012
Quote:
Originally Posted by FuTuяe
pawn Код:
if(strcmp(cmd, "/moveleft", true) == 0) { new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); MoveObject(Object[PlayerMovingObject[playerid]], x, y + 1, z, 9999, 0.0, 0.0, 0.0); y = y+1; return 1; }
|
y = y+1 is not request.
Re: [Help] Floats -
Tika Spic - 29.02.2012
I think you didn't get the point i need to move the object more end more to one side without moving the character at all
for example i type /moveleft 10 times and it moves +10 on the Y float and what you gave me will just move it +1 away from me... Thanks anyway...
@TheArcher what do you mean?
Re: [Help] Floats -
TheArcher - 01.03.2012
Quote:
Originally Posted by Tika Spic
I think you didn't get the point i need to move the object more end more to one side without moving the character at all
for example i type /moveleft 10 times and it moves +10 on the Y float and what you gave me will just move it +1 away from me... Thanks anyway...
@TheArcher what do you mean?
|
what is y = y+1 used for? You already have the "y" axis on your moving function.
Re: [Help] Floats -
Ballu Miaa - 01.03.2012
Why dont you simply use this?
pawn Код:
if(strcmp(cmd, "/moveleft", true) == 0)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
MoveObject(Object[PlayerMovingObject[playerid]], x, y + 1, z, 9999, 0.0, 0.0, 0.0);
return 1;
}
This will do the require task man. y=y+1; increment's y while it is already being incremented over here
pawn Код:
MoveObject(Object[PlayerMovingObject[playerid]], x, y + 1, z, 9999, 0.0, 0.0, 0.0); ".
Your CMD will move the object to y+1 only once. On Second stroke it will add 2 to y pos. So i recommend you to use this one!