MoveObject isn't working? Or something else
#1

Hey, yep another topic.

This time I have made a gang gate. Everything works except for one thing

pawn Код:
if(strcmp(cmdtext, "/opengate", true) == 0)
    {
        if(gTeam[playerid] == TEAM_GROVE)
        {
            if(InGangWar[playerid] == 1)
            {
               if(IsPlayerInRangeOfPoint(playerid,7.0,2459.8665,-1659.3862,13.3047))
               {
                 MoveObject(ggate,2463.75976562,-1658.75488281,21.06310654,20);
                 SendClientMessage(playerid,COLOR_YELLOW,"You have opened the grove street gate! Make sure to close it /closegate");
               }
               else SendClientMessage(playerid,COLOR_RED,"You are not close enough to this gate");
            }
            else SendClientMessage(playerid,COLOR_WHITE,"SERVER: Unknown command.");
        }
        else SendClientMessage(playerid,COLOR_RED,"You do not have access to this gate!");
        return 1;
    }
Thats my opengate command, as I said everything except one is working.
Now what isn't working is the gate.

The message displays but the gate(Moveobject) Does not open.
I am positive I have the right coords.

This is my gate object:
pawn Код:
//On top:
new ggate;
//ongamemodenit
ggate = CreateDynamicObject(980,2463.76025391,-1658.75500488,15.06310654,0.00000000,0.00000000,90.00000000); //object(airportgate) (1)
Yes as I said I am positive they are the right coords, all the gate is meant to do is be moved up.
Look at the createdynamicobject code's Z Position. Then look at the MoveObject's
It's only being moved up.

Any idea as to why this isn't working ?

Thanks.
Reply
#2

You are using the Streamer Plugin to create the object, thus you need to use the Streamer Plugin to move the object! Here is the function provided by the plugin to use:
pawn Код:
native MoveDynamicObject(objectid, Float:x, Float:y, Float:z, Float:speed);
// example:
MoveDynamicObject(ggate,2463.75976562,-1658.75488281,21.06310654,20);
Reply
#3

Quote:
Originally Posted by Jay.
Посмотреть сообщение
Hey, yep another topic.

This time I have made a gang gate. Everything works except for one thing

pawn Код:
if(strcmp(cmdtext, "/opengate", true) == 0)
    {
        if(gTeam[playerid] == TEAM_GROVE)
        {
            if(InGangWar[playerid] == 1)
            {
               if(IsPlayerInRangeOfPoint(playerid,7.0,2459.8665,-1659.3862,13.3047))
               {
                 MoveObject(ggate,2463.75976562,-1658.75488281,21.06310654,20);
                 SendClientMessage(playerid,COLOR_YELLOW,"You have opened the grove street gate! Make sure to close it /closegate");
               }
               else SendClientMessage(playerid,COLOR_RED,"You are not close enough to this gate");
            }
            else SendClientMessage(playerid,COLOR_WHITE,"SERVER: Unknown command.");
        }
        else SendClientMessage(playerid,COLOR_RED,"You do not have access to this gate!");
        return 1;
    }
Thats my opengate command, as I said everything except one is working.
Now what isn't working is the gate.

The message displays but the gate(Moveobject) Does not open.
I am positive I have the right coords.

This is my gate object:
pawn Код:
//On top:
new ggate;
//ongamemodenit
ggate = CreateDynamicObject(980,2463.76025391,-1658.75500488,15.06310654,0.00000000,0.00000000,90.00000000); //object(airportgate) (1)
Yes as I said I am positive they are the right coords, all the gate is meant to do is be moved up.
Look at the createdynamicobject code's Z Position. Then look at the MoveObject's
It's only being moved up.

Any idea as to why this isn't working ?

Thanks.
I had this problem too Yesterday. See if my failure post helps yours.

My Failure in post form...
Reply
#4

Quote:
Originally Posted by Grim_
Посмотреть сообщение
You are using the Streamer Plugin to create the object, thus you need to use the Streamer Plugin to move the object! Here is the function provided by the plugin to use:
pawn Код:
native MoveDynamicObject(objectid, Float:x, Float:y, Float:z, Float:speed);
// example:
MoveDynamicObject(ggate,2463.75976562,-1658.75488281,21.06310654,20);
How stupid can I be....
Cheers! That did the trick!

Shockey: No , but thanks.
Reply
#5

Damnnn LOL
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)