rampe,kapije

Započeo Ante_Dracar aka Lopa, Jun 18, 2010, 14:13:03 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 2 gostiju pregledaju ovu temu.

Evo ljudi treba mi pomoc,ovako zanima me mogu li se sve ove rampe i kapije otvarati jednoj komandom...
//------------------------------- Policijske Rampe -------------------------------
    if(strcmp(cmd,"/shipo",true)==0)
{
    if(IsPlayerConnected(playerid))
    {
            if(PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)
    {
    MoveStreamObject(Ship1, -1324.69140625, 515.056640625, 4.7507610321045, 5.0);
    MoveStreamObject(Ship2, -1335.3594970703, 487.53192138672, 5.9608917236328, 5.0);
    MoveStreamObject(Ship3, -1422.0720214844, 494.87976074219, -1.6875462532043, 5.0);
    MoveStreamObject(Ship4, -1367.2182617188, 514.3671875, 7.9321947097778, 5.0);
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "Odblokirali ste sve ulaze u brod.");
}
else
{
SendClientMessage(playerid, COLOR_GREY, "   Niste clan !");
        return 1;
    }
}
    return 1;
}
if(strcmp(cmd,"/shipc",true)==0)
{
    if(IsPlayerConnected(playerid))
    {
    if(PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)
    {
    MoveStreamObject(Ship1, -1324.69140625, 515.056640625, 10.750761032104, 5.0);
    MoveStreamObject(Ship2, -1335.3594970703, 487.53192138672, 12.960891723633, 5.0);
    MoveStreamObject(Ship3, -1422.0720214844, 494.87976074219, 4.8124537467957, 5.0);
    MoveStreamObject(Ship4, -1367.2182617188, 514.3671875, 11.682194709778, 5.0);
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "Blokirali ste sve ulaze u brod.");
}
else
{
SendClientMessage(playerid, COLOR_GREY, "   Niste clan !");
        return 1;
    }
}
    return 1;
}
if(strcmp(cmd,"/ao",true)==0)
{
    if(IsPlayerConnected(playerid))
    {
            if(PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)
    {
    MoveStreamObject(Vojska, -1530.1025390625, 482.3427734375, 3.1043772697449, 5.0);
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "Kapija se otvorila.");
}
else
{
SendClientMessage(playerid, COLOR_GREY, "   Niste clan !");
        return 1;
    }
}
    return 1;
}
if(strcmp(cmd,"/ac",true)==0)
{
    if(IsPlayerConnected(playerid))
    {
    if(PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)
    {
    MoveStreamObject(Vojska, -1530.0286865234, 482.2936706543, 7.8543772697449, 5.0);
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "Kapija se zatvorila.");
}
else
{
SendClientMessage(playerid, COLOR_GREY, "   Niste clan !");
        return 1;
    }
}
    return 1;
}
if(strcmp(cmd,"/pdr1o",true)==0)
{
    if(IsPlayerConnected(playerid))
    {
    if(IsACop(playerid))
    {
    SetObjectRot(Police1, 0.0000, 0.8594, 270.0000);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Rampa se podigla.");
}
else
{
SendClientMessage(playerid, COLOR_GREY, "   Niste clan !");
        return 1;
    }
}
    return 1;
}
if(strcmp(cmd,"/pdr1z",true)==0)
{
    if(IsPlayerConnected(playerid))
    {
    if(IsACop(playerid))
    {
    SetObjectRot(Police1, 0.0000, 269.7591, 270.0000);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Rampa se spustila.");
}
else
{
SendClientMessage(playerid, COLOR_GREY, "   Niste clan !");
        return 1;
    }
}
    return 1;
}
if(strcmp(cmd,"/pdr2o",true)==0)
{
    if(IsPlayerConnected(playerid))
    {
    if(IsACop(playerid))
    {
    SetObjectRot(Police2, 0.0000, 359.1406, 270.0000);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Rampa se podigla.");
}
else
{
SendClientMessage(playerid, COLOR_GREY, "   Niste clan !");
        return 1;
    }
}
    return 1;
}
if(strcmp(cmd,"/pdr2z",true)==0)
{
    if(IsPlayerConnected(playerid))
    {
    if(IsACop(playerid))
    {
    SetObjectRot(Police2, 0.0000, 89.3814, 270.0000);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Rampa se spustila.");
}
else
{
SendClientMessage(playerid, COLOR_GREY, "   Niste clan !");
        return 1;
    }
}
    return 1;
}
if(strcmp(cmd,"/pdo",true)==0)
{
    if(IsPlayerConnected(playerid))
    {
    if(IsACop(playerid))
    {
    MoveStreamObject(PoliceGate1, -1645.854980, 688.355286, 8.960892, 5.0);
                MoveStreamObject(PoliceGate2, -1657.384766, 688.359070, 8.970608, 5.0);
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "Kapija se otvorila.");
}
else
{
SendClientMessage(playerid, COLOR_GREY, "   Niste clan !");
        return 1;
    }
}
    return 1;
}
if(strcmp(cmd,"/pdz",true)==0)
{
    if(IsPlayerConnected(playerid))
    {
    if(IsACop(playerid))
    {
    MoveStreamObject(PoliceGate1, -1625.054688, 688.355286, 8.960892, 5.0);
                MoveStreamObject(PoliceGate2, -1636.583496, 688.359070, 8.960892, 5.0);
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "Kapija se zatvorila.");
}
else
{
SendClientMessage(playerid, COLOR_GREY, "   Niste clan !");
        return 1;
    }
}
    return 1;
}




ili ako nw mogu sve mogu li bar ove dvije rampe...
if(strcmp(cmd,"/pdr1o",true)==0)
{
    if(IsPlayerConnected(playerid))
    {
    if(IsACop(playerid))
    {
    SetObjectRot(Police1, 0.0000, 0.8594, 270.0000);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Rampa se podigla.");
}
else
{
SendClientMessage(playerid, COLOR_GREY, "   Niste clan !");
        return 1;
    }
}
    return 1;
}
if(strcmp(cmd,"/pdr1z",true)==0)
{
    if(IsPlayerConnected(playerid))
    {
    if(IsACop(playerid))
    {
    SetObjectRot(Police1, 0.0000, 269.7591, 270.0000);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Rampa se spustila.");
}
else
{
SendClientMessage(playerid, COLOR_GREY, "   Niste clan !");
        return 1;
    }
}
    return 1;
}
if(strcmp(cmd,"/pdr2o",true)==0)
{
    if(IsPlayerConnected(playerid))
    {
    if(IsACop(playerid))
    {
    SetObjectRot(Police2, 0.0000, 359.1406, 270.0000);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Rampa se podigla.");
}
else
{
SendClientMessage(playerid, COLOR_GREY, "   Niste clan !");
        return 1;
    }
}
    return 1;
}
if(strcmp(cmd,"/pdr2z",true)==0)
{
    if(IsPlayerConnected(playerid))
    {
    if(IsACop(playerid))
    {
    SetObjectRot(Police2, 0.0000, 89.3814, 270.0000);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Rampa se spustila.");
}
else
{
SendClientMessage(playerid, COLOR_GREY, "   Niste clan !");
        return 1;
    }
}
    return 1;
}





Skini LA:RP Mod, i pretrazi u njemu za /gateopen, tu imas primjer kako i sta
Aequam memento rebus in arduis servare mentem.

evo ti iz gtarp moda kako je napravljena kapija od pd,fbi i swata na jednu komandu ti probaj samo zamjenjivat brojke:

if(!strcmp(cmdtext, "/gateopen", true)) // By Ellis
{
   if(PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pLeader] == 3 || PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pMember] == 3)
    {
        if (PlayerToPoint(15, playerid,1589.053344,-1638.123168,14.122960))
{
      MoveObject(pdgate1,1599.053344,-1638.123168,14.122960, 0.8);
      SetTimer("GateClose", 12000, 0);
      SendClientMessage(playerid, COLOR_BLUE,"A garage is opened and will close in 7 seconds.");
      GetPlayerName(playerid, sendername, sizeof(sendername));
      format(string, sizeof(string), "* %s takes his/her remote and opens a garage.", sendername);
      ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
      PlayerPlaySound(playerid, 1153, 1589.053344,-1638.123168,14.122960);
}
else if (PlayerToPoint(15, playerid,1544.700317,-1630.735717,13.096980))
{
      DestroyObject( pdgate2 );
      pdgate3 = CreateStreamObject(968,1544.700317,-1630.735717,12.924660,0.000000,0.000000,270.972869);
      SetTimer("GateClose5", 6000, 0);
      SendClientMessage(playerid, COLOR_BLUE,"The gate is opened and will close in 6 seconds.");
      GetPlayerName(playerid, sendername, sizeof(sendername));
      format(string, sizeof(string), "* %s takes his/her remote and opens the gate.", sendername);
      ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else if (PlayerToPoint(15, playerid,1534.9020,-1451.5979,14.4882))
{
      MoveObject(fbigate,1534.9020,-1451.5979,20.4882, 1.5);
      SetTimer("GateClose3", 7000, 0);
      SendClientMessage(playerid, COLOR_BLUE,"FBI gate is opened and will close in 7 seconds.");
      GetPlayerName(playerid, sendername, sizeof(sendername));
      format(string, sizeof(string), "* %s takes his/her remote and opens fbi gate.", sendername);
      ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else if (PlayerToPoint(15, playerid,1643.3379,-1714.9338,15.3067))
{
      MoveObject(hspdgate,1643.3379,-1705.9338,15.3067, 1.5);
      SetTimer("GateClose4", 7000, 0);
      SendClientMessage(playerid, COLOR_BLUE,"HSPD gate is opened and will close in 7 seconds.");
      GetPlayerName(playerid, sendername, sizeof(sendername));
      format(string, sizeof(string), "* %s takes his/her remote and opens hspd gate.", sendername);
      ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else { SendClientMessage(playerid, COLOR_GREY,"Destination is too far."); }
}
else if(PlayerInfo[playerid][pLeader] == 8)
{
         if (PlayerToPoint(15, playerid,321.22927856445,-1188.4171142578,79.021339416504))
         {
   MoveObject(matijag,321.22927856445,-1188.4171142578,69.021339416504,2.2);
   GetPlayerName(playerid, sendername, sizeof(sendername));
   format(string, sizeof(string), "* %s takes his/her remote and opens HQ gate.", sendername);
   ProxDetector(30.0, playerid, string, COLOR_GREY,COLOR_GREY,COLOR_GREY,COLOR_GREY,COLOR_GREY);
}
    else { SendClientMessage(playerid, COLOR_GREY,"Destination is too far."); }
}
else if(PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pLeader] == 3 || PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pMember] == 3)
{
    if (PlayerToPoint(15, playerid,317.75305175781,-1191.0656738281,75.556167602539))
    {
   MoveObject(matijag,317.75305175781,-11921.0656738281,75.556167602539,2.2);
   GetPlayerName(playerid, sendername, sizeof(sendername));
   format(string, sizeof(string), "* %s takes his/her remote and opens HQ gate.", sendername);
   ProxDetector(30.0, playerid, string, COLOR_BLACK,COLOR_BLACK,COLOR_BLACK,COLOR_BLACK,COLOR_BLACK);
}
else { SendClientMessage(playerid, COLOR_GREY,"Destination is too far."); }
}

    return 1;
}