[Ajuda]Nгo consigo entrar em carros recйm adicionados
#1

Bom, adicionei uns veiculos pelo mta, botei no meu servidor samp jб e tudo, mas quando vou entrar simplismente nгo consigo.
Acredito que tenha haver com essas variaveis: if(newcar >= 78 && newcar <= 83) , mas 78 nгo й um id de veiculo valido, e agora?
PS: Os carros que tentei adicionar sгo turismo, infernus, banshe, nrg...
Reply
#2

tipo,voce diz que quando vai entrar em um veiculo fala que voce nao e de tal org?
Reply
#3

Quote:
Originally Posted by Gustavo_Araujo
Посмотреть сообщение
tipo,voce diz que quando vai entrar em um veiculo fala que voce nao e de tal org?
Nгo, simplismente quando aperto F nгo vai, nenhuma mensagem й enviada.
Reply
#4

Deve ser algo em : "OnPlayerKeyStateChange",posta ele ai.
Reply
#5

Quote:
Originally Posted by Gustavo_Araujo
Посмотреть сообщение
Deve ser algo em : "OnPlayerKeyStateChange",posta ele ai.
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if ((newkeys==KEY_ACTION)&&(IsPlayerInAnyVehicle(playerid))&&(GetPlayerState(playerid)==PLAYER_STATE_DRIVER))
    {
        if (GetVehicleModel(GetPlayerVehicleID(playerid)) == 525)
        {
            new Float:pXg,Float:pYg,Float:pZg;
            GetPlayerPos(playerid,pXg,pYg,pZg);
            new Float:vXg,Float:vYg,Float:vZg;
            new Found=0;
            new vid=0;
            while((vid<MAX_VEHICLES)&&(!Found))
            {
                vid++;
                GetVehiclePos(vid,vXg,vYg,vZg);
                if  ((floatabs(pXg-vXg)<7.0)&&(floatabs(pYg-vYg)<7.0)&&(floatabs(pZg-vZg)<7.0)&&(vid!=GetPlayerVehicleID(playerid)))
                {
                    Found=1;
                    if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
                    {
                        DetachTrailerFromVehicle(GetPlayerVehicleID(playerid));
                    }
                    else
                    {
                        AttachTrailerToVehicle(vid,GetPlayerVehicleID(playerid));
                        SendClientMessage(playerid,VERDECLARO,"Carro Guinchado!");
                    }
                }
            }
            if  (!Found)
            {
                SendClientMessage(playerid,VERMELHO,"Nгo tem nenhum veнculo por perto.");
            }
        }
    }
    // garage hq staff
        if(newkeys && KEY_HANDBRAKE)
    {
        if(IsPlayerInRangeOfPoint(playerid,10,2998.50000000,-2027.69995117,10.30000019) && IsPlayerInAnyVehicle(playerid))
        {
            OnPlayerCommandText(playerid, "/abrirgarage");
        }
    }
    // hq staff
        if(newkeys && KEY_HANDBRAKE)
    {
        if(IsPlayerInRangeOfPoint(playerid,10,2994.2998046875,-1983.69921875,12.800000190735) && IsPlayerInAnyVehicle(playerid))
        {
            OnPlayerCommandText(playerid, "/abrirstaff");
        }
    }
    // hq pm
        if(newkeys && KEY_HANDBRAKE)
    {
        if(IsPlayerInRangeOfPoint(playerid,10,1544.8994140625,-1623.69921875,15.199999809265) && IsPlayerInAnyVehicle(playerid))
        {
            OnPlayerCommandText(playerid, "/abrirportao");
        }
    }
    if((newkeys == KEY_HORN) && (IsPlayerInAnyVehicle(playerid)))
    {
        if(gTeam[playerid] == 2  || IsACop(playerid) || PlayerInfo[playerid][pLeader] == 13 || PlayerInfo[playerid][pMember] == 13)
        {
            OnPlayerCommandText(playerid,"/portao");
        }
    }
    return 1;
}
Nгo seria no OnPlayerStateChange?
Reply
#6

OnPlayerKEYstateChange nгo afeta em nada o GTA, sу seu GM, vc n consegue bloquear que ele entre no carro com o keystatechange sem que ele se dirija pro veiculo...

ceesar, vc diz que quando vc aperta F o seu personagem nem entra no veiculo? os veiculos estгo em cima de algum map?
Reply
#7

Quote:
Originally Posted by Pharrel
Посмотреть сообщение
OnPlayerKEYstateChange nгo afeta em nada o GTA, sу seu GM, vc n consegue bloquear que ele entre no carro com o keystatechange sem que ele se dirija pro veiculo...

ceesar, vc diz que quando vc aperta F o seu personagem nem entra no veiculo? os veiculos estгo em cima de algum map?
Isso que acontece: [ame]http://www.youtube.com/watch?v=Z0rjfO-djnM[/ame]
E criei sobre um mapa, botei um chao sobre o mar tambйm.
Reply
#8

desculpa o double post mas ninguйm sabe como resolver?
Reply
#9

Poste o OnPlayerStateChange ...
Reply
#10

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    new string[256];
    new str[128];
    new pveh = GetVehicleModel(GetPlayerVehicleID(playerid));
    new vehicle = GetPlayerVehicleID(playerid);
    //------------------------CONCE------------------------
    if (CarShopping[playerid] == false)
    {
        if (newstate == PLAYER_STATE_DRIVER)
        {
            new carid = GetPlayerVehicleID(playerid);
            if(carid >= 395 && carid <= 472)
            {
                new casa = carid - 395;
                if(!strcmp(HouseInfo[casa][hOwner],GetName(playerid)))
                {
                }
                else
                {
                    SendClientMessage(playerid, RED, "Somente o dono do carro pode digiri-lo !");
                    RemovePlayerFromVehicle(playerid);
                }
            }
            if(carid >= 473)
            {
                new criado[128];
                format(criado, sizeof(criado), "criado");
                if(!strcmp(VehicleInfo[vehicle][vOwner],criado))
                {
                }
                else if(!strcmp(VehicleInfo[vehicle][vOwner],GetName(playerid)))
                {
                }
                else
                {
                    SendClientMessage(playerid, RED, "Somente o dono do carro pode digiri-lo !");
                    RemovePlayerFromVehicle(playerid);
                }
            }
            else
            {
            }
        }
    }
    //--------------------------FIM CONCE-----------------------
    // turismo staff
        if(newstate == PLAYER_STATE_DRIVER)//Caso o jogador ser o motorista.
    {
        if(GetPlayerVehicleID(playerid) == TurismoStaff /*|| GetPlayerVehicleID(playerid) == TurismoStaff2 || 3, 4, 5...*/)//Caso o veнculo que ele entrou й o TurismoStaff.
        {
            if (PlayerInfo[playerid][pAdmin] < 2)
            {
                RemovePlayerFromVehicle(playerid);
                SendClientMessage(playerid, -1, "Vocк nгo й admin!");
                return 1;
            }//Caso nгo for admin, ele й removido do veнculo e envia a mensagem.
        }
    }
    if(newstate == PLAYER_STATE_DRIVER && (pveh != 481 && pveh != 510) && IsPlayerInAnyVehicle(playerid) && !IsAPlane(vehicle) && !IsAHarvest(vehicle) && !IsADrugHarvest(vehicle) && !IsASweeper(vehicle))
    {
        SetTimerEx("Startup", 1, false, "ii", playerid, vehicle);
        SetTimerEx("engine2", 2500, false, "ii", playerid);
        format(str, sizeof(str), "~g~%s",vehName[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
        GameTextForPlayer(playerid, str, 3000, 1);
    }
    else if(newstate == PLAYER_STATE_DRIVER && (pveh != 481 && pveh != 510) && IsPlayerInAnyVehicle(playerid) && !IsAPlane(vehicle) && !IsAHarvest(vehicle) && !IsADrugHarvest(vehicle) && !IsASweeper(vehicle))
    {
        SetTimerEx("Startup", 1, false, "ii", playerid, vehicle);
        SetTimerEx("engine2", 2500, false, "ii", playerid);
        format(str, sizeof(str), "~g~%s",vehName[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
        GameTextForPlayer(playerid, str, 3000, 1);
    }
    if(newstate == PLAYER_STATE_ONFOOT)
    {
        if(PlayerKarting[playerid] > 0 && PlayerInKart[playerid] > 0)
        {
            PlayerInKart[playerid] = 0;
            KartingPlayers --;
        }
        if(TransportDuty[playerid] > 0)
        {
            if(TransportDuty[playerid] == 1)
            {
                TaxiDrivers -= 1;
            }
            else if(TransportDuty[playerid] == 2)
            {
                BusDrivers -= 1;
            }
            TransportDuty[playerid] = 0;
            format(string, sizeof(string), "* Vocк parou de trabalhar e ganhou $%d.", TransportMoney[playerid]);
            SendClientMessage(playerid, COLOR_WHITE, string);
            SafeGivePlayerMoney(playerid, TransportMoney[playerid]);
            /*ConsumingMoney[playerid] = 1;*/ TransportValue[playerid] = 0; TransportMoney[playerid] = 0;
        }
        if(TransportCost[playerid] > 0 && TransportDriver[playerid] < 999)
        {
            if(IsPlayerConnected(TransportDriver[playerid]))
            {
                TransportMoney[TransportDriver[playerid]] += TransportCost[playerid];
                TransportTime[TransportDriver[playerid]] = 0;
                TransportCost[TransportDriver[playerid]] = 0;
                format(string, sizeof(string), "~w~A corrida custa~n~~r~$%d",TransportCost[playerid]);
                GameTextForPlayer(playerid, string, 5000, 1);
                format(string, sizeof(string), "~w~O passageiro deixou o carro~n~~g~Ganhou $%d",TransportCost[playerid]);
                GameTextForPlayer(TransportDriver[playerid], string, 5000, 1);
                SafeGivePlayerMoney(playerid, -TransportCost[playerid]);
                TransportCost[playerid] = 0;
                TransportTime[playerid] = 0;
                TransportDriver[playerid] = 999;
            }
        }
        TelePos[playerid][0] = 0.0;
        TelePos[playerid][1] = 0.0;
    }
    if(newstate == PLAYER_STATE_PASSENGER) // TAXI & BUSSES
    {
        new name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, sizeof(name));
        new vehicleid = GetPlayerVehicleID(playerid);
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                if(IsPlayerInVehicle(i, vehicleid) && GetPlayerState(i) == 2 && TransportDuty[i] > 0)
                {
                    if(GetPlayerMoney(playerid) < TransportValue[i])
                    {
                        format(string, sizeof(string), "* Vocк precisa de $%d para entrar.", TransportValue[i]);
                        SendClientMessage(playerid, COLOR_WHITE, string);
                        RemovePlayerFromVehicle(playerid);
                    }
                    else
                    {
                        if(TransportDuty[i] == 1)
                        {
                            format(string, sizeof(string), "* Vocк pagou $%d para o Taxista.", TransportValue[i]);
                            SendClientMessage(playerid, COLOR_WHITE, string);
                            format(string, sizeof(string), "* O passageiro %s entrou no seu Taxi.", name);
                            SendClientMessage(i, COLOR_WHITE, string);
                            TransportTime[i] = 1;
                            TransportTime[playerid] = 1;
                            TransportCost[playerid] = TransportValue[i];
                            TransportCost[i] = TransportValue[i];
                            TransportDriver[playerid] = i;
                        }
                        else if(TransportDuty[i] == 2)
                        {
                            format(string, sizeof(string), "* Vocк pagou $%d para o Motorista.", TransportValue[i]);
                            SendClientMessage(playerid, COLOR_WHITE, string);
                            format(string, sizeof(string), "* O passageiro %s entrou no seu Фnibus.", name);
                            SendClientMessage(i, COLOR_WHITE, string);
                        }
                        SafeGivePlayerMoney(playerid, - TransportValue[i]);
                        TransportMoney[i] += TransportValue[i];
                    }
                }
            }
        }
    }
    if(newstate == PLAYER_STATE_WASTED)
    {
        if(WantedLevel[playerid] >= 1)
        {
            new price = WantedLevel[playerid] * 1000;
            new count;
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                if(IsPlayerConnected(i))
                {
                    if(gTeam[i] == 2 && CrimInRange(30.0, playerid,i))
                    {
                        count = 1;
                        format(string, sizeof(string), "~w~Fugitivo~r~Morto~n~Bonus~g~$%d", price);
                        GameTextForPlayer(i, string, 5000, 1);
                        //ConsumingMoney[i] = 1;
                        SafeGivePlayerMoney(i, price / 2);
                        PlayerPlaySound(i, 1058, 0.0, 0.0, 0.0);
                    }
                }
            }
            if(count == 1)
            {
                SafeGivePlayerMoney(playerid, - price);
                PlayerInfo[playerid][pWantedDeaths] += 1;
                PlayerInfo[playerid][pJailed] = 1;
                PlayerInfo[playerid][pJailTime] = (WantedLevel[playerid])*(120);
                format(string, sizeof(string), "* Vocк estб preso por %d Segundos e perdeu $%d por fugir e tomar um tiro do Policial.", PlayerInfo[playerid][pJailTime], price);
                SendClientMessage(playerid, COLOR_LIGHTRED, string);
                WantedPoints[playerid] = 0;
                WantedLevel[playerid] = 0;
            }
        }
    }

    if(newstate == PLAYER_STATE_DRIVER)
    {// 38 / 49 / 56 = SS
        new newcar = GetPlayerVehicleID(playerid);
        new oldcar = gLastCar[playerid];
        new housecar = PlayerInfo[playerid][pPhousekey]+1;
        TelePos[playerid][0] = 0.0;
        TelePos[playerid][1] = 0.0;
        if(IsABoat(newcar))
        {
            if(PlayerInfo[playerid][pBoatLic] < 1)
            {
                SendClientMessage(playerid, COLOR_GREY, "   Vocк nгo sabe navegar ainda, entгo foi ejetado !");
                RemovePlayerFromVehicle(playerid);
                TogglePlayerControllable(playerid, 1);
            }
        }
        else if(IsAPlane(newcar))
        {
            if(PlayerInfo[playerid][pFlyLic] < 1)
            {
                if(TakingLesson[playerid] == 1) { }
                else {
                SendClientMessage(playerid, COLOR_GREY, "   Vocк nгo sabe voar ainda, entгo foi ejetado !");
                RemovePlayerFromVehicle(playerid);
                TogglePlayerControllable(playerid, 1); }
            }
        }
        else
        {
            if(PlayerInfo[playerid][pCarLic] < 0)
            {
                if(PlayerDrunk[playerid] >= 5)
                {
                    WantedPoints[playerid] += 1;
                    SetPlayerCriminal(playerid,255, "Dirgindo Bкbado");
                }

            }
            else if(PlayerDrunk[playerid] >= 5)
            {
                WantedPoints[playerid] += 1;
                SetPlayerCriminal(playerid,255, "Dirgindo Bкbado");
            }

            if(PlayerInfo[playerid][pCarLic] < 1)
            {
                if(IsABike(newcar) || IsAOBike(newcar)) { }
                else
                {
                    /*if(PlayerInfo[playerid][pCarLic] < 1)
                    {
                        WantedPoints[playerid] += 1;
                        SetPlayerCriminal(playerid,255, "Driving without License");
                    }*/

                    if(DrivingTest[playerid] == 1) { }
                    else {
                    SendClientMessage(playerid, COLOR_YELLOW, "   Vocк nгo tem a Licenзa de Motorista ainda! Dirija com cuidado ou a polнcia vai notar.");
                  }
                }
            }
        }//Done with car check
        if(IsACopCar(newcar))
        {
            if(PlayerInfo[playerid][pLeader] == 1||PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 2||PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 3||PlayerInfo[playerid][pMember] == 3) { }
            else {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_GREY,"Vocк nгo й da PM.");}
        }
        if(IsATank(newcar))
        {
            if(PlayerInfo[playerid][pLeader] == 1||PlayerInfo[playerid][pLeader] == 2||PlayerInfo[playerid][pLeader] == 3) { }
            else {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_GREY,"Apenas Lнderes podem usar o Tanque.");}
        }
        if(IsAnFbiCar(newcar))
        {
            if(PlayerInfo[playerid][pLeader] == 2||PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 1||PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 3||PlayerInfo[playerid][pMember] == 3) { }
            else {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_GREY,"Vocк nгo й do FBI.");}
        }
        if(IsNgCar(newcar))
        {
            if(PlayerInfo[playerid][pLeader] == 3||PlayerInfo[playerid][pMember] == 3) { }
            else {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_GREY,"Vocк nгo й do Exйrcito.");}
        }
        if(IsAHspdCar(newcar))
        {
            if(PlayerInfo[playerid][pLeader] == 1||PlayerInfo[playerid][pMember] == 1 && PlayerInfo[playerid][pRank] > 2) { }
            else {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_GREY,"Apenas membros com Cargos maiores que 2 podem usar esse veнculo.");}
        }
        else if(IsAnAmbulance(newcar))
        {
            if(PlayerInfo[playerid][pMember] == 4||PlayerInfo[playerid][pLeader] == 4) { }
            else {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_GREY,"Vocк nгo й do Samu.");}
        }
        if(IsAAztecaCar(newcar))
        {
            if(PlayerInfo[playerid][pLeader] == 5||PlayerInfo[playerid][pMember] == 5) { }
            else {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_GREY,"Vocк nгo й Azteca.");}
        }
        if(IsAMafiaCar(newcar))
        {
            if(PlayerInfo[playerid][pLeader] == 6||PlayerInfo[playerid][pMember] == 6) { }
            else {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_GREY,"Vocк nгo й da MaFia Italiana.");}
        }
        if(IsAHitmanCar(newcar))
        {
            if(PlayerInfo[playerid][pLeader] == 8||PlayerInfo[playerid][pMember] == 8) { }
            else {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_GREY,"Vocк nгo й Hitman.");}
        }
        if(IsAAbcCar(newcar))
        {
            if(PlayerInfo[playerid][pLeader] == 9||PlayerInfo[playerid][pMember] == 9) { }
            else {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_GREY,"Vocк nгo й Repуrter.");}
        }
        if(IsATaxiCar(newcar))
        {
            if(PlayerInfo[playerid][pLeader] == 10||PlayerInfo[playerid][pMember] == 10) { }
            else {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_GREY,"Vocк nгo й Taxista.");}
        }
        if(IsABallaCar(newcar))
        {
            if(PlayerInfo[playerid][pLeader] == 11||PlayerInfo[playerid][pMember] == 11) { }
            else {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_GREY,"Vocк nгo й dos Ballas.");}
        }
        if(IsAYakuzaCar(newcar))
        {
            if(PlayerInfo[playerid][pLeader] == 14||PlayerInfo[playerid][pMember] == 14) { }
            else {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_GREY,"Vocк nгo й da Yakuza.");}
        }
        if(IsAGrooveCar(newcar))
        {
            if(PlayerInfo[playerid][pLeader] == 15||PlayerInfo[playerid][pMember] == 15) { }
            else {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_GREY,"Vocк nгo й da Groove Street.");}
        }
        if(IsAVagosCar(newcar))
        {
            if(PlayerInfo[playerid][pLeader] == 16||PlayerInfo[playerid][pMember] == 16) { }
            else {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_GREY,"Vocк nгo й Los Vagos.");}
        }
        if(IsAQaedaCar(newcar))
        {
            if(PlayerInfo[playerid][pLeader] == 13||PlayerInfo[playerid][pMember] == 13) { }
            else {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_GREY,"Vocк nгo й da Al'Qaeda.");}
        }
        if(IsAPizzabike(newcar))
        {
            if(PlayerInfo[playerid][pJob] == 17) { }
            else {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_GREY,"Vocк nгo tem as chaves desse veнculo.");}
        }
        if(IsABus(newcar))
        {
            if(PlayerInfo[playerid][pJob] == 14)
            {
                GameTextForPlayer(playerid, "~w~Use /irleste ou /iroeste para comeзar sua rota de onibus", 5000, 3);
                SendClientMessage(playerid, COLOR_YELLOW2, "Vocк entrou no фnibus, digite /sair para cancelar a rota selecionada.");
                //GangZoneShowForPlayer(playerid, buszonewest, COLOR_RED);
                //GangZoneShowForPlayer(playerid, buszoneeast, COLOR_BLUE);
                SendClientMessage(playerid, COLOR_YELLOW2, "Para comeзar a fazer a rota oeste, use /iroeste. Para comeзar a fazer a rota leste, use /irleste.");
                new routezonecheck = IsInBusrouteZone(playerid);
                if (routezonecheck == 0) SendClientMessage(playerid, COLOR_YELLOW, "Nota: Sua rota й para o Leste.");
                else if (routezonecheck == 1) SendClientMessage(playerid, COLOR_YELLOW, "Note: Sua rota й para o Oeste.");
                TogglePlayerControllable(playerid, 0);
            }
            else {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_GREY,"Vocк nгo tem as chaves desse фnibus.");}
        }
        if(IsATowcar(newcar))
        {
            if(PlayerInfo[playerid][pJob] == 7) { }
            else {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_GREY,"Vocк nгo tem as chaves desse veнculo.");}
        }
        if(IsATruck(newcar))
        {
            if(PlayerInfo[playerid][pJob] == 16)
            {
                format(string, sizeof(string), "Produtos: %d/%d", PlayerHaul[newcar][pLoad],PlayerHaul[newcar][pCapasity]);
                SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
                SendClientMessage(playerid, COLOR_WHITE, "INFO: Vocк pode entregar Produtos para Empresas.");
                SendClientMessage(playerid, COLOR_WHITE, "INFO: Os comandos sгo /carregar /comprarprods /venderprods");
            }
            else
            {
                RemovePlayerFromVehicle(playerid);
                SendClientMessage(playerid, COLOR_GREY,"Vocк nгo tem as chaves desse veнculo.");
            }
        }
        if(IsASweeper(newcar))
        {
            if(PlayerInfo[playerid][pJob] == 21)
            {
                if(PlayerIsSweeping[playerid] == 0)
                {
                    TogglePlayerControllable(playerid, 0);
                    GameTextForPlayer(playerid, "~g~/varrer ~w~ para comecar a varrer~n~Dgite ~r~/sair ~w~para deixar a vassoura", 5000, 3);
                }
                else
                {
                    SendClientMessage(playerid, COLOR_WHITE, "Voce pode parar de varrer, digitando /pararvarrer .");
                }
            }
            else
            {
                RemovePlayerFromVehicle(playerid);
                SendClientMessage(playerid, COLOR_GREY,"Vocк nгo tem as chaves desse veнculo.");
            }
        }
        if(PlayerKarting[playerid] != 0)
        {
            new kart = GetPlayerVehicleID(playerid);
            if(kart >=78 && kart <= 83)
            {
                PlayerInKart[playerid] = 1;
                KartingPlayers ++;
            }
        }
        if(newcar >= 131 && newcar <= 134)
        {
            if(DrivingTest[playerid] == 1)
            {
                SendClientMessage(playerid, COLOR_WHITE, "   INFO: Passe pelos checkpoint para completar o teste.");
                SendClientMessage(playerid,COLOR_LIGHTBLUE,"|| Para passar no teste, complete o percurso sem danificar muito o carro. ||");
                SetPlayerCheckpoint(playerid, 1971.5177,-1930.0858,13.3958, 5.0);
                DrivingStep[playerid] = 1;
            }
            else
            {
                SendClientMessage(playerid, COLOR_LIGHTRED, "  Vocк nгo estб fazendo o teste de direзгo !");
                RemovePlayerFromVehicle(playerid);
                TogglePlayerControllable(playerid, 1);
            }
        }
        if(newcar == 167)
        {
            SendClientMessage(playerid,COLOR_GREY," (( O Teste de Vфo estб desativado )) ");
            RemovePlayerFromVehicle(playerid);
        }
        if(newcar == 166)
        {
            if(PlayerInfo[playerid][pMember] == 4) { }
            else
            {
                SendClientMessage(playerid,COLOR_GREY,"   Vocк nгo tem as chaves desse caminhгo !");
                RemovePlayerFromVehicle(playerid);
            }
        }
        if(newcar == 38)
        {
            if(PlayerInfo[playerid][pRank] >= 3) { }
            else
            {
                SendClientMessage(playerid,COLOR_GREY,"   Vocк precisa ter Cargo 3 para voar neste veнculo !");
                RemovePlayerFromVehicle(playerid);
            }
        }
        if(newcar >= 96 && newcar <= 98)
        {
            if(PlayerInfo[playerid][pJob] != 16)
            {
                SendClientMessage(playerid,COLOR_GREY,"   Vocк nгo tem as chaves desse caminhгo !");
                RemovePlayerFromVehicle(playerid);
            }
        }
        /*if(newcar >= 61 && newcar <= 70)
        {
            if(PlayerInfo[playerid][pMember] == 10||PlayerInfo[playerid][pLeader] == 10) { }
            else
            {
                SendClientMessage(playerid,COLOR_GREY,"   Vocк nгo tem as chaves desse veнculo !");
                RemovePlayerFromVehicle(playerid);
            }
        }*/

        /*if(newcar >= 71 && newcar <= 73)
        {
            if(PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pLeader] == 9){ }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "   Vocк nгo tem as chaves desse veнculo !");
                RemovePlayerFromVehicle(playerid);
            }
        }*/

        if(newcar >= 78 && newcar <= 83)
        {
            if(PlayerKarting[playerid] != 1)
            {
                RemovePlayerFromVehicle(playerid);
            }
        }
        if(newcar >= 135 && newcar <= 154)
        {
            if (HireCar[playerid] != newcar)
            {
                format(string, sizeof(string), "~w~Voce pode alugar este carro~n~Custo:~g~$500~n~~w~Para alugar digite ~g~/alugarcarro~w~~n~para sair digite ~r~/sair");
                TogglePlayerControllable(playerid, 0);
                GameTextForPlayer(playerid, string, 5000, 3);
            }
        }
        /*if(newcar >= 56 && newcar <= 58)
        {
            if(PlayerInfo[playerid][pMember] == 8||PlayerInfo[playerid][pLeader] == 8) { }
            else
            {
                SendClientMessage(playerid,COLOR_GREY,"   Vocк nгo tem as chaves desse veнculo !");
                RemovePlayerFromVehicle(playerid);
            }
        }*/

        if(IsAHarvest(newcar))
        {
            if(PlayerInfo[playerid][pJob] == 18)
            {
                if(FarmerVar[playerid] == 0)
                {
                    SendClientMessage(playerid, COLOR_RED, "_________________Guia do Fazendeiro_________________");
                    SendClientMessage(playerid, COLOR_WHITE, "** Fazendeiro ** /colher, /pararcolher ou /sair");
                    SendClientMessage(playerid, COLOR_RED, "____________________________________________________");
                    TogglePlayerControllable(playerid, 0);
                }
                else { }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "   Vocк nгo tem as chaves desse veнculo !");
                RemovePlayerFromVehicle(playerid);
            }
        }
        if(IsADrugHarvest(newcar))
        {
            if(PlayerInfo[playerid][pJob] == 19)
            {
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "___________________Guia do Fazendeiro de Ilegal__________________");
                SendClientMessage(playerid, COLOR_WHITE, "** Fazendeiro Ilegal ** /colherdrogas, /pararcolherdrogas or /sair");
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "_________________________________________________________________");
                TogglePlayerControllable(playerid, 0);
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "   Vocк nгo tem as chaves desse veнculo !");
                RemovePlayerFromVehicle(playerid);
            }
        }
        if(IsASmuggleCar(newcar))
        {
            if(PlayerInfo[playerid][pJob] == 20)
            {
                if(PlayerInfo[playerid][pMember] == 16 || PlayerInfo[playerid][pLeader] == 16)
                {
                    SendClientMessage(playerid, COLOR_YELLOW, "Dica: Vocк pode contrabandear drogas agora !");
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "   Vocк nгo tem as chaves desse veнculo !");
                    RemovePlayerFromVehicle(playerid);
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "   Vocк nгo tem as chaves desse veнculo !");
                RemovePlayerFromVehicle(playerid);
            }
        }
        if(oldcar != 301)
        {
            if((housecar != oldcar && oldcar != 0) && (HireCar[playerid] != oldcar && newcar != housecar))
            {
                if(gLastDriver[oldcar] == playerid && oldcar != newcar)
                {
                    gLastDriver[oldcar] = 300;
                    gCarLock[oldcar] = 0;
                    UnLockCar(oldcar);
                }
            }
        }
        if(IsAnOwnableCar(newcar))
        {
            if(CarInfo[newcar][cOwned]==0)
            {
                TogglePlayerControllable(playerid, 0);
                format(string,sizeof(string),"~w~Carro: %s~n~Preco: ~g~%d~n~~w~/v comprar para comprar esse veiculo~n~~r~/sair ~w~para sair desse veiculo",CarInfo[newcar][cDescription],CarInfo[newcar][cValue]);
                GameTextForPlayer(playerid,string,5000,5);
            }
            if(CarInfo[newcar][cOwned]==1)
            {
                format(string,sizeof(string),"Veнculo em nome de %s",CarInfo[newcar][cOwner]);
                SendClientMessage(playerid, COLOR_BLUE, string);
                /*if(keycar != vehicle)
                {
                    RemovePlayerFromVehicle(playerid);
                    SendClientMessage(playerid, COLOR_GREY, "You don't have a key of this vehicle");
                }*/

                if(PlayerInfo[playerid][pPcarkey] == vehicle) { }
                else if(PlayerInfo[playerid][pPcarkey2] == vehicle) { }
                else if(PlayerInfo[playerid][pPcarkey3] == vehicle) { }
                else
                {
                    if(PlayerInfo[playerid][pAdmin] >= 1337 && AdminDuty[playerid] == 1)
                    {
                        SendClientMessage(playerid, COLOR_GREY, "  Vocк pode dirigir este carro, porque й o admin de plantгo !");
                    }
                    else
                    {
                        RemovePlayerFromVehicle(playerid);
                        SendClientMessage(playerid, COLOR_GREY, "Vocк nгo tem as chaves desse veнculo!");
                    }
                }
            }
        }
        gLastCar[playerid] = newcar;
        gLastDriver[newcar] = playerid;
    }
    if(newstate == PLAYER_STATE_SPAWNED)
    {
        new Float: lwx, Float:lwy, Float:lwz;
        GetPlayerPos(playerid, lwx, lwy, lwz);
        if((lwz > 530.0 && PlayerInfo[playerid][pInt] == 0) || PlayerToPoint(1000.0, playerid, -1041.9,-1868.4,79.1)) //the highest land point in sa = 526.8
        {
            SetPlayerSpawn(playerid);
        }
        if(WantedPoints[playerid] > 0)
        {
            new dstring[128];
            new wanted = WantedPoints[playerid]/2;
            new diecash = 0;
            while(WantedPoints[playerid] > 0)
            {
                diecash += 500;
                WantedPoints[playerid] --;
            }
            format(dstring, sizeof(dstring), "Vocк perdeu $%d por morrer com %d Nнveis de Procurado.", diecash, wanted);
            SendClientMessage(playerid, COLOR_YELLOW, dstring);
            SafeGivePlayerMoney(playerid, - diecash);
            PlayerInfo[playerid][pWantedDeaths] += 1;
        }
        if(PlayerOnMission[playerid] > 0)
        {
            GameTextForPlayer(playerid, "~r~Missгo falhou", 5000, 3);
            PlayerOnMission[playerid] = 0;
            PlayerInfo[playerid][pMissionNr] = 0;
        }
        WantedPoints[playerid] = 0;
        WantedLevel[playerid] = 0;
        if(PlayerInfo[playerid][pDonateRank] > 0) { SetPlayerHealth(playerid, 100.0); }
        else { SetPlayerHealth(playerid, 100.0+PlayerInfo[playerid][pSHealth]); }
        MedicBill[playerid] = 1;
        TelePos[playerid][0] = 0.0;
        TelePos[playerid][1] = 0.0;
        gPlayerSpawned[playerid] = 1;
        SafeTime[playerid] = 60;
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)