[Ajuda] Distancia do Carro
#1

Fiz esses dois comandos para trancar e destrancar o carro pelo id/placa.
Mas consigo usar eles de qualquer lugar, gostaria de saber o qual a forma de usar um ProxDetector do player para o carro, pesqueisei e nгo achei nada, se puderem ao invйs de adaptar o comando me mandar um tutorial uma breve explicaзгo ajudaria, pois mais pra frente prescisarei fazer outros comandos do mesmo estilo, att J.R

pawn Код:
if (strcmp(cmd, "/trancarc", true) == 0)
    {
            tmp = strtok(cmdtext, idx);
            new vid = strval(tmp);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /trancarc [carid]");
                return 1;
            }
            if(PlayerInfo[playerid][pCarKey] != vid && PlayerInfo[playerid][pCarKey2] != vid && PlayerInfo[playerid][pCarKey3] != vid && HireCar[playerid] != vid
            && PlayerInfo[playerid][pCarroOrg1] != vid && PlayerInfo[playerid][pCarroOrg2] != vid && PlayerInfo[playerid][pCarroOrg3] != vid && PlayerInfo[playerid][pCarroOrg4] != vid
            && PlayerInfo[playerid][pCarroOrg5] != vid && PlayerInfo[playerid][pCarroOrg6] != vid && PlayerInfo[playerid][pCarroOrg7] != vid && PlayerInfo[playerid][pCarroOrg8] != vid
            && PlayerInfo[playerid][pCarroOrg9] != vid && PlayerInfo[playerid][pCarroOrg10] != vid && PlayerInfo[playerid][pCarroOrg11] != vid && PlayerInfo[playerid][pCarroOrg12] != vid
            && PlayerInfo[playerid][pCarroOrg13] != vid && PlayerInfo[playerid][pCarroOrg14] != vid && PlayerInfo[playerid][pCarroOrg15] != vid && PlayerInfo[playerid][pCarroOrg16] != vid
            && PlayerInfo[playerid][pCarroOrg17] != vid && PlayerInfo[playerid][pCarroOrg18] != vid && PlayerInfo[playerid][pCarroOrg19] != vid && PlayerInfo[playerid][pCarroOrg20] != vid)
            {
            SendClientMessage(playerid, COR_PM, "Vocк nгo tem a chave deste veнculo.");
            return 1;
     }
            new viados[MAX_PLAYER_NAME];
            SendClientMessage(playerid, 0xFFFFFFAA, "Veнculo {F60000}Trancado!");
            GetPlayerName(playerid, viados, sizeof(viados));
            format(string, sizeof(string), "* %s trancou o veiculo com a placa %03d.", viados,vid);
            ProxDetector(20.0, playerid, string, ROXO,ROXO,ROXO,ROXO,ROXO);
            VTrancado[vid] = 1;
            LockCar(vid);
            return true;
    }
pawn Код:
if (strcmp(cmd, "/destrancarc", true) == 0)
    {
            tmp = strtok(cmdtext, idx);
            new vid = strval(tmp);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /destrancarc [carid]");
                return 1;
            }
            if(PlayerInfo[playerid][pCarKey] != vid && PlayerInfo[playerid][pCarKey2] != vid && PlayerInfo[playerid][pCarKey3] != vid && HireCar[playerid] != vid
            && PlayerInfo[playerid][pCarroOrg1] != vid && PlayerInfo[playerid][pCarroOrg2] != vid && PlayerInfo[playerid][pCarroOrg3] != vid && PlayerInfo[playerid][pCarroOrg4] != vid
            && PlayerInfo[playerid][pCarroOrg5] != vid && PlayerInfo[playerid][pCarroOrg6] != vid && PlayerInfo[playerid][pCarroOrg7] != vid && PlayerInfo[playerid][pCarroOrg8] != vid
            && PlayerInfo[playerid][pCarroOrg9] != vid && PlayerInfo[playerid][pCarroOrg10] != vid && PlayerInfo[playerid][pCarroOrg11] != vid && PlayerInfo[playerid][pCarroOrg12] != vid
            && PlayerInfo[playerid][pCarroOrg13] != vid && PlayerInfo[playerid][pCarroOrg14] != vid && PlayerInfo[playerid][pCarroOrg15] != vid && PlayerInfo[playerid][pCarroOrg16] != vid
            && PlayerInfo[playerid][pCarroOrg17] != vid && PlayerInfo[playerid][pCarroOrg18] != vid && PlayerInfo[playerid][pCarroOrg19] != vid && PlayerInfo[playerid][pCarroOrg20] != vid)

            {
            SendClientMessage(playerid, COR_PM, "Vocк nгo tem a chave deste veнculo.");
            return 1;
            }
            new viados[MAX_PLAYER_NAME];
            SendClientMessage(playerid, 0xFFFFFFAA, "Veнculo {2F991A}Aberto!");
            GetPlayerName(playerid, viados, sizeof(viados));
            format(string, sizeof(string), "* %s destrancou o veiculo com a placa %03d.", viados,vid);
            ProxDetector(20.0, playerid, string, ROXO,ROXO,ROXO,ROXO,ROXO);
            VTrancado[vid] = 0;
            UnLockCar(vid);
            return true;
    }
Reply
#2

new Float + GetVehiclePos + IsPlayerInRangeOfPoint
https://sampwiki.blast.hk/wiki/Function:GetVehiclePos
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
Reply
#3

Obrigado!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)