ajuda com comandos
#1

tipo eu tenho o /go pra abrir portao ai eu quero pra usar o "espaзo" pra abrir
Reply
#2

posta o cmd /go e seu OnPlayerKeyStateChange que eu faзo
Reply
#3

wiki.sa-mp.com/wiki/OnPlayerKeyStateChange
Preguiзa mata, principalmente se for pra nгo olhar na Wiki.
Reply
#4

Код:
    if(!strcmp(cmdtext, "/go", true)) // By CuervO_NegrO
    {
        if(IsAPDMember(playerid) || IsAFreecop(playerid))
        {
               if (IsPlayerInRangeOfPoint(playerid, 15,1589.053344,-1638.123168,14.122960))
            {
                if(lspdg == 1) { SendClientMessage(playerid, COLOR_GREY, "** Gate is Already Opened"); return 1; }
                  MoveDynamicObject(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.");
                   format(string, sizeof(string), "* %s takes his/her remote and opens a garage.", sendername);
                   ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
                   PlayerPlaySound(playerid, 1153, 1589.053344,-1638.123168,14.122960);
                 lspdg = 1;
            }
            else if (IsPlayerInRangeOfPoint(playerid, 15,1544.700317,-1630.735717,13.096980))
            {
                if(lspdg2 == 1) { SendClientMessage(playerid, COLOR_GREY, "** Barrier is Already Opened"); return 1; }
                   DestroyDynamicObject( pdgate2 );
                 pdgate3 = CreateDynamicObject(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.");
                 format(string, sizeof(string), "* %s takes his/her remote and opens the gate.", sendername);
                ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
                lspdg2 = 1;
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY,"* Not near a Gate that you can use.");
                return 1;
            }
        }
        else if(PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)
        {
            if (IsPlayerInRangeOfPoint(playerid, 15,2720.3772,-2409.7523,12.6))
            {
                if(armyg == 1) { SendClientMessage(playerid, COLOR_GREY, "** Gate is Already Opened"); return 1; }
                   MoveDynamicObject(armygate1,2720.3772, -2401.2523, 12.6, 3.5);
                   SetTimer("GateClose2", 7000, 0);
                SendClientMessage(playerid, COLOR_BLUE,"The Army gate Nr. 1 is opened and will close in 7 seconds.");
                 GetPlayerName(playerid, sendername, sizeof(sendername));
                 format(string, sizeof(string), "* %s takes his/her remote and opens the army gate #1.", sendername);
                  ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
                  armyg = 1;
            }
            else if (IsPlayerInRangeOfPoint(playerid, 15,2720.3772,-2508.3069,12.6))
            {
                if(armyg2 == 1) { SendClientMessage(playerid, COLOR_GREY, "** Gate is Already Opened"); return 1; }
                  MoveDynamicObject(armygate2,2720.3772, -2499.8069, 12.6, 3.5);
                  SetTimer("GateClose2", 7000, 0);
                  SendClientMessage(playerid, COLOR_BLUE,"The Army gate Nr. 2 is opened and will close in 7 seconds.");

                  format(string, sizeof(string), "* %s takes his/her remote and opens the army gate #2.", sendername);
                  ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
                  armyg2 = 1;
            }
            else if(IsPlayerInRangeOfPoint(playerid, 10, 2773.2056,-2494.8267,13.6681))
              {
                  if(PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)
                  {
                    if(PlayerInfo[playerid][pRank] >= 5)
                    {
                        MoveDynamicObject(armygate3, 2774.4670,-2494.5842,8.2665, 2.5);
                        SetTimer("GateClose2", 7000, 0);
                        SendClientMessage(playerid, COLOR_BLUE,"The gate is opened and will close in 7 seconds.");

                        format(string, sizeof(string), "* %s takes his/her remote and opens Rhino Gate.", sendername);
                          ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
                    }
                }
            }
Reply
#5

vc temabem precisa postar as variaveis dos objetos, deve ser pdgate, vou ver aqui no larp, seu gm eh o larp neh, ele eh muito bom
Reply
#6

sim й sim
Reply
#7

entao posta aqui as variaveis dos objetos
Reply
#8

Код:
if((newkeys == KEY_HORN) && (IsPlayerInAnyVehicle(playerid)))
	{
			OnPlayerCommandText(playerid,"/go");
    }
    return 1;
}

// Quando ele buzinar ele vai abrir os portхes, se nгo gostou do buzinar, troca p/a tecla desejada.
Reply
#9

mais como coloco isso?
Reply
#10

Код:
wiki.sa-mp.com/wiki/OnPlayerKeyStateChange
Mano sу uma dica.
http://cronosbr.blogspot.com/2008/10...s-de-pawn.html

Joga samp primeiro, ou se nгo pega um GM feito do 0 e olha ele todo, copia algumas funзхes e cria outras, para depois tu editar um godfather lixo, da vida.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)