How to make 2 gates open at the same time?
#1

Hey, I tried making 2 gates open at the same time using the same CMD but it doesn't work So I was wondering if there is another way to make this. Here is the PAWNO code I used please help me out I'll rep!
pawn Код:
#include <a_samp>
#include <streamer>

#define FILTERSCRIPT
#pragma tabsize 0

#define COLOR_BLUE 0x0000BBAA

#define COLOR_RED 0xAA3333AA

#define COLOR_LIGHTBLUE 0x33CCFFAA

new LVCCompany;
new SFDMCompany;
new SFDPCompany1;
new SFDPCompany2;

public OnFilterScriptInit()
{
    LVCCompany = CreateObject(980,1337.3000488,687.9000244,12.6000004,0.0000000,0.0000000,270.0000000); //LV Church Deport *kinda* Company Gate
    SFDMCompany = CreateObject(980,-2047.0500000,-102.7800000,36.0000000,0.0000000,0.0000000,0.0000000); // SF Driver License Main Gate
    SFDPCompany1 = CreateObject(980,-2022.9000000,-102.8100000,36.0500000,0.0000000,0.0000000,0.0000000); // SF Driver License Parking Gate 1
    SFDPCompany2 = CreateObject(980,-2034.4400000,-102.8100000,36.0500000,0.0000000,0.0000000,0.0000000); // SF Driver License Parking Gate 2
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
/* ===================== LV CHRUCH AERA GATE *COMPANY GATE* MAIN ENTRANCE =============== */
    if(!strcmp(cmdtext, "/og", true)){
        if(IsPlayerInRangeOfPoint(playerid, 15.0, 1337.3000488,687.9000244,12.6000004)){
            MoveObject(LVCCompany, 1337.3000488,687.9000244,17.6509991, 3.0, 0.0000000,0.0000000,270.0000000);
            SendClientMessage(playerid, COLOR_BLUE, "LVCCompany Opened Successfuly , Weclome !");
            return 1;
        }
    }
    if(!strcmp(cmdtext, "/cg", true)){
        if(IsPlayerInRangeOfPoint(playerid, 15.0,  1337.3000488,687.9000244,12.6000004)){
            MoveObject(LVCCompany,  1337.3000488,687.9000244,12.6000004, 3.0, 0.0000000,0.0000000,270.0000000);
            SendClientMessage(playerid, COLOR_RED, "LVCCompany Closed successfuly !");
            return 1;
        }
    }
/* ===================== SF DRIVER LICENSE AERA GATE *COMAPNY GATE* MAIN ENTRANCE =============== */
    if(!strcmp(cmdtext, "/og", true)){
        if(IsPlayerInRangeOfPoint(playerid, 15.0, -2047.0500000,-102.7800000,36.0000000)){
            MoveObject(SFDMCompany, -2059.0900000,-102.8700000,36.0000000, 3.0, 0.0000000,0.0000000,0.0000000);
            SendClientMessage(playerid, COLOR_BLUE, " SFDMCompany Opened Successfuly , Weclome !");
            return 1;
        }
    }
    if(!strcmp(cmdtext, "/cg", true)){
        if(IsPlayerInRangeOfPoint(playerid, 15.0,  -2047.0500000,-102.7800000,36.0000000)){
            MoveObject(SFDMCompany, -2047.0500000,-102.7800000,36.0000000, 3.0, 0.0000000,0.0000000,0.0000000);
            SendClientMessage(playerid, COLOR_RED, "SFDMCompany Closed successfuly !");
            return 1;
        }
    }
/* ===================== SF DRIVER LICENSE AERA GATE *COMAPNY GATE* PARKING GATES =========OPEN CMD====== */
    if(!strcmp(cmdtext, "/op", true)){
        if(IsPlayerInRangeOfPoint(playerid, 15.0, -2022.9000000,-102.8100000,36.0500000)){
            MoveObject(SFDPCompany1, -2022.9000000,-102.8100000,31.2700000, 3.0, 0.0000000,0.0000000,0.0000000);
            SendClientMessage(playerid, COLOR_BLUE, " SFDPCompany Opened Successfuly , Weclome !");
            return 1;
        }
    }
   
    if(!strcmp(cmdtext, "/op", true)){
        if(IsPlayerInRangeOfPoint(playerid, 15.0, -2034.4400000,-102.8100000,36.0500000)){
            MoveObject(SFDPCompany2, -2034.4400000,-102.8100000,31.1000000, 3.0, 0.0000000,0.0000000,0.0000000);
            SendClientMessage(playerid, COLOR_BLUE, " SFDPCompany Opened Successfuly , Weclome !");
            return 1;
        }
    }
/* ===================== SF DRIVER LICENSE AERA GATE *COMAPNY GATE* PARKING GATES =========CLOSE CMD====== */
    if(!strcmp(cmdtext, "/cp", true)){
        if(IsPlayerInRangeOfPoint(playerid, 15.0, -2022.9000000,-102.8100000,36.0500000)){
            MoveObject(SFDPCompany1, -2022.9000000,-102.8100000,36.0500000,0.0000000,0.0000000,0.0000000);
            SendClientMessage(playerid, COLOR_RED, "SFDPCompany Closed successfuly !");
            return 1;
        }
    }
   
    if(!strcmp(cmdtext, "/cp", true)){
        if(IsPlayerInRangeOfPoint(playerid, 15.0, -2034.4400000,-102.8100000,36.0500000)){
            MoveObject(SFDPCompany2, -2034.4400000,-102.8100000,36.0500000,0.0000000,0.0000000,0.0000000);
            SendClientMessage(playerid, COLOR_RED, "SFDPCompany Closed successfuly !");
            return 1;
        }
    }

    return 0;
}
public OnFilterScriptExit()
{
    return 1;
}
Reply
#2

add 2 MoveObject() to the same CMD
and delete one of the command's
Reply
#3

If you want, you can tell me which gates you want moved at the same time, and I'll do it for you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)