I have a problem opening a gate
#1

Ive scripted in a gate and I've made a command to move it. Now when I enter the command the gate doesn't move!?]
What's the problem

Here's my code, by the way:

if (strcmp(cmdtext, "/gate", true)==0)
{
if(IsPlayerInRangeOfPoint(playerid,20,782.09326171 875, -1384.7810058594, 12.75))
{
MoveObject(gate,773.91998291016, -1384.759765625, 12.704795837402, 3.0);
SendClientMessage(playerid, COLOR_YELLOW, "Gate has opened");
return 1;
}
if(IsPlayerInRangeOfPoint(playerid,20,782.09326171 875, -1384.7810058594, 12.75))
{
MoveObject(gate,782.34002685547, -1384.7600097656, 12.704795837402, 3.0)
SendClientMessage(playerid, COLOR_YELLOW, "Gates have closed");
return 1;
}
Reply
#2

Add at the top where you have all your variables
pawn Код:
new gate;
Add to ongamemodeinit
pawn Код:
gate = 1;
Command
pawn Код:
if (strcmp(cmdtext, "/gate", true)==0)
{
    if(IsPlayerInRangeOfPoint(playerid,20,782.09,-1384.78,12.75))
    {
        if(gate == 0)
        {
            MoveObject(gate,773.91998291016, -1384.759765625, 12.704795837402, 3.0);
            SendClientMessage(playerid, COLOR_YELLOW, "Gate has opened");
            gate = 1;
        }
        else
        {
            MoveObject(gate,782.34002685547, -1384.7600097656, 12.704795837402, 3.0)
            SendClientMessage(playerid, COLOR_YELLOW, "Gates have closed");
            gate = 0;
        }
    }
    return 1;
}
You must have a check to see if the gate is open or closed.
Reply
#3

Thanks for replying, I'll try this out
Reply
#4

Alright, I tried the code it compiled great, but when I went In-Game, the gates still don't open. Could it be the speed?
Reply
#5

maybe u has tuped wrong coords CHECK IT.
You has tuped coords on the closed gate...
Or maybe u has make another filterscript with that gate

Good Luck !
Reply
#6

Not even I just checked the coords;If anyone has gone through this and know a solution,please post here.For the meantime, I will re-check the coords as said above.
Reply
#7

make sure that the close co-ordinates are mostly the build co-ordinates so i expect that u made the gate in (mta map editor?) closed and that coords are the closing coords
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)