Jump to content
  • 0

Problema comanda lock


MoD

Question

Problema intalnita (descriere):Detin un gm samp mai exact bigzone si la comanda /lock cand dau lock se blocheaza doar prima masina , merg langa cea dea doua masina chiar daca e la 150 de m de prima dau lock si imi spune ca nu sunt langa masina ! Deci doar prima masina o pot bloca/debloca restul de 5 nu !
Ero(area / rile) / warning-(ul / urile):Nu am 
Liniile de cod / sursa / script-ul(obligatoriu):http://pastebin.com/f75ea06e7
Imagini / Video (optional):Nu
Ati incercat sa rezolvati singur?: De doua zile incerc si nu gasesc nici un raspuns am apelat la dumneavoastra deoarece aveti mai multa experienta !

Va multumesc 

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

CMD:lock(playerid, params[])
{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
    if(IsPlayerConnected(playerid))
    {
        new engine,lights,alarm,doors,bonnet,boot,objective;
        if(SwitchKey[playerid] == 1)
        {
            new string[100];
            for(new v=0; v<MAX_PVEHS; v++)
            {
                 if(personalcar[v][playerid] != 0)
                  {
                    if(CheckPlayerDistanceToVehicle(5.0, playerid, personalcar[v][playerid]))
                    {
                         if(CarInfo[OwnedVeh(personalcar[v][playerid])][cLock] == 1)
                          {
                            GetVehicleParamsEx(personalcar[v][playerid],engine,lights,alarm,doors,bonnet,boot,objective);
                              SetVehicleParamsEx(personalcar[v][playerid],engine,lights,alarm,0,bonnet,boot,objective);
                            format(string, sizeof(string), "~h~%s~n~~g~Unlocked",CarInfo[OwnedVeh(personalcar[v][playerid])][cDescription]);
                            GameTextForPlayer(playerid, string, 4000, 4);
                            PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
                            CarInfo[OwnedVeh(personalcar[v][playerid])][cLock] = 0;
                            gCarLock[personalcar[v][playerid]] = 0;
                            vUpdate(OwnedVeh(personalcar[v][playerid]), cLockx); //
                            return 1;
                        }
                        else if(CarInfo[OwnedVeh(personalcar[v][playerid])][cLock] == 0)
                        {
                            GetVehicleParamsEx(personalcar[v][playerid],engine,lights,alarm,doors,bonnet,boot,objective);
                              SetVehicleParamsEx(personalcar[v][playerid],engine,lights,alarm,1,bonnet,boot,objective);
                            format(string, sizeof(string), "~h~%s~n~~r~Locked",CarInfo[OwnedVeh(personalcar[v][playerid])][cDescription]);
                            GameTextForPlayer(playerid, string, 4000, 4);
                            PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
                            CarInfo[OwnedVeh(personalcar[v][playerid])][cLock] = 1;
                            gCarLock[personalcar[v][playerid]] = 1;
                            vUpdate(OwnedVeh(personalcar[v][playerid]), cLockx); //
                            return 1;
                        }
                    }
                    else return SendClientMessage(playerid, COLOR_WHITE, "{FFB870}Your vehicle not near you.");
                 }
                else return SendClientMessage(playerid, COLOR_WHITE, "{FFB870}You don't have a vehicle.");
            }
        }
        else if(SwitchKey[playerid] == 2)
        {
            new carid,string[128];
            if(HireCar[playerid] == -1) return SCM(playerid,COLOR_WHITE,"{FFB870}You do not have a rental car/boat/bike/scooter already.");
            if(HireCar[playerid] != -1)
            {
                carid = HireCar[playerid];
            }
            if(CheckPlayerDistanceToVehicle(5.0, playerid, HireCar[playerid]))
            {
                if(gCarLock[carid] == 0)
                {
                    new vehicles = GetVehicleModel(carid) - 400;
                    format(string, sizeof(string), "~h~%s~n~~r~Locked", aVehicleNames[vehicles]);
                    GameTextForPlayer(playerid, string, 4000, 4);
                      PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
                    gCarLock[carid] = 1;
                    GetVehicleParamsEx(HireCar[playerid],engine,lights,alarm,doors,bonnet,boot,objective);
                      SetVehicleParamsEx(HireCar[playerid],engine,lights,alarm,1,bonnet,boot,objective);
                    return 1;
                }
                else if(gCarLock[carid] == 1)
                {
                    new vehicles = GetVehicleModel(carid) - 400;
                    format(string, sizeof(string), "~h~%s~n~~g~Unlocked", aVehicleNames[vehicles]);
                    GameTextForPlayer(playerid, string, 4000, 4);
                    PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
                    gCarLock[carid] = 0;
                    GetVehicleParamsEx(HireCar[playerid],engine,lights,alarm,doors,bonnet,boot,objective);
                      SetVehicleParamsEx(HireCar[playerid],engine,lights,alarm,0,bonnet,boot,objective);
                    return 1;
                }
            }
        }
    }
    return 1;
}

Daca ai gm bigzone, nou

  • Upvote 1
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.