Moving objects
#1

Hello!

im trying to get the lifts on a carrier i made to move, but the objects seams not want to move.
There was other coords for the carrier before and did work perfekt in a another script.
pawn Код:
CreateObject(10771, -710.54571533203, 439.33242797852, 5.8306694030762, 0, 0, 0);
    CreateObject(10772, -708.83465576172, 439.06365966797, 17.619731903076, 0, 0, 0);
    CreateObject(11145, -773.44921875, 439.35635375977, 4.6152801513672, 0, 0, 0);
    CreateObject(11146, -719.54907226563, 439.89633178711, 12.66983795166, 0, 0, 0);
    CreateObject(11149, -716.69549560547, 434.15139770508, 12.33000087738, 0, 0, 0);
    CreateObject(10770, -707.29998779297, 431.79949951172, 39.019409179688, 0, 0, 0);
    CreateObject(11237, -707.28997802734, 431.79998779297, 39, 0, 0, 0);
    CreateObject(3578, -657.97503662109, 431.92181396484, 18.397766113281, 0, 0, 90);
    CreateObject(3578, -667.84881591797, 431.39080810547, 18.397766113281, 0, 0, 90);
    CreateObject(3578, -662.74243164063, 428.82431030273, 18.397766113281, 0, 0, 0);
    CreateObject(3578, -787.63690185547, 426.92434692383, 18.39282989502, 0, 0, 0);
    CreateObject(3578, -782.65399169922, 431.80291748047, 18.397766113281, 0, 0, 90);
    CreateObject(3578, -792.58599853516, 431.71655273438, 18.397766113281, 0, 0, 90);
    lift1 = CreateObject(3115, -809.56597900391, 439.33920288086, 17.329999923706, 0, 0, 0);
    lift2 = CreateObject(3114, -767.31213378906, 454.49496459961, 17.059999465942, 0, 0, 0);
    door = CreateObject(3113, -818.6015625, 439.40496826172, 1.5, 0, 0, 0);
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp(cmdtext, "/aftup", true)==0)
       {
      MoveObject (lift1,-809.56597900391, 439.33920288086, 17.329999923706, 0.0);
      SendClientMessage(playerid, 0xFFFF00AA, "Activating aft lift up Sir");
      return 1;
       }
    if (strcmp(cmdtext, "/aftdown", true)==0)
    {
       MoveObject (lift1,-809.56597900391, 439.33920288086, 10.260000228882, 0.0);
       SendClientMessage(playerid, 0xFFFF00AA, "Activating aft lift down Sir");
       return 1;
    }
    if (strcmp(cmdtext, "/portup", true)==0)
       {
      MoveObject (lift2,-767.31213378906, 454.49496459961, 17.059999465942, 0.0);
      SendClientMessage(playerid, 0xFFFF00AA, "Activating port lift up Sir");
      return 1;
       }
    if (strcmp(cmdtext, "/portdown", true)==0)
    {
       MoveObject (lift2, -767.31213378906, 454.49496459961, 9.9989995956421, 0.0);
       SendClientMessage(playerid, 0xFFFF00AA, "Activating port lift down Sir");
       return 1;
    }
    if (strcmp(cmdtext, "/doorup", true)==0)
       {
      MoveObject (door,-818.6015625, 439.40496826172, 1.5, 0.0);
      SendClientMessage(playerid, 0xFFFF00AA, "Activating aft door up Sir");
      return 1;
       }
    if (strcmp(cmdtext, "/doordown", true)==0)
    {
       MoveObject (door,1735.369507, -2797.054443, -11.988692,0.5);
       SendClientMessage(playerid, 0x000000F, "Activating aft door updown Sir");
       return 1;
    }
    return 0;
}
So i made a new carrier, and put the new lift cords from were to were with the cmd.
But they dont move, how can the new coords make the objects not move anymore?
Reply
#2

Its because the speed is 0.0

MoveObject(objectid, Float:X, Float:Y, Float:Z, Float:Speed)
MoveObject (lift1,-809.56597900391, 439.33920288086, 17.329999923706, 0.0);
Reply
#3

Quote:
Originally Posted by Wesley221
Посмотреть сообщение
Its because the speed is 0.0

MoveObject(objectid, Float:X, Float:Y, Float:Z, Float:Speed)
MoveObject (lift1,-809.56597900391, 439.33920288086, 17.329999923706, 0.0);
Ah! so stupid of me, thanks!
Reply
#4

I have put the script into my GM, and the cmds in OnPlayerCommandText does not work, i get (unknown command)

So i was make the cmds like COMMAND:mycommand(playerid, params[]), but i want only members of team 1 to be able to use the cmds

but when i have this the object doesnt move and i only get the message, if i delete it works fine
pawn Код:
if(Member[playerid] == 1)
What am i doing wrong?
pawn Код:
COMMAND:aftup(playerid, params[])
{
    if(Member[playerid] == 1)
    MoveObject (lift1,-809.56597900391, 439.33920288086, 17.329999923706, 0.5);
    SendClientMessage(playerid, 0xFFFF00AA, "Activating aft lift up Sir");
    return 1;
}
COMMAND:aftdown(playerid, params[])
{
    if(Member[playerid] == 1)
    MoveObject (lift1,-809.56597900391, 439.33920288086, 10.260000228882, 0.5);
    SendClientMessage(playerid, 0xFFFF00AA, "Activating aft lift down Sir");
    return 1;
}
Reply
#5

pawn Код:
COMMAND:aftup(playerid, params[])
{
    if(Member[playerid] == 1)
    {
        MoveObject (lift1,-809.56597900391, 439.33920288086, 17.329999923706, 0.5);
        SendClientMessage(playerid, 0xFFFF00AA, "Activating aft lift up Sir");
        return 1;
    }
    return 1;
}
COMMAND:aftdown(playerid, params[])
{
    if(Member[playerid] == 1)
    {
        MoveObject (lift1,-809.56597900391, 439.33920288086, 10.260000228882, 0.5);
        SendClientMessage(playerid, 0xFFFF00AA, "Activating aft lift down Sir");
        return 1;
    }
    return 1;
}
This should work
Reply
#6

Lol.... How can a car move at 0kmph?
Anyway, you should clean a bit your script, and i recommend you to read some ZCMD tuts. It is much easier.
Reply
#7

Quote:
Originally Posted by ricardo178
Посмотреть сообщение
Lol.... How can a car move at 0kmph?
Anyway, you should clean a bit your script, and i recommend you to read some ZCMD tuts. It is much easier.
Lol on ur self, all makes mistakes sometimes.

And what is a mess with my script? its pretty simple and works anyways..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)