Jump to content
  • 0

Question

Posted

Problema intalnita (descriere): Nu merge comanda /lock1 si /lock2 
Ero(area / rile) / warning-(ul / urile): --
Liniile de cod / sursa / script-ul:

else if(strcmp(x_nr,"lock",true) == 0)
            {
                new keycar = PlayerInfo[playerid][pPcarkey];
                if(keycar != 9999)
                {
                    new Float:X,Float:Y,Float:Z;
                    GetVehiclePos(keycar,X,Y,Z);
                    if(IsPlayerInRangeOfPoint(playerid, 25,X,Y,Z))
                    {
                        new locked[128];
                        locked = strtok(cmdtext, idx);
                        if(CarInfo[keycar][cLock] == 1)
                        {
                            format(string, sizeof(string), "~w~Vehicle~n~~g~Unlocked");
                            GameTextForPlayer(playerid, string, 4000, 3);
                            SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),playerid,0,0);
                            CarInfo[keycar][cLock] = 0;
                            OnPropUpdate(4,keycar);
                            return 1;
                        }
                        else if(CarInfo[keycar][cLock] == 0)
                        {
                            format(string, sizeof(string), "~w~Vehicle~n~~r~Locked");
                            GameTextForPlayer(playerid, string, 4000, 3);
                            SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),playerid,0,1);
                            CarInfo[keycar][cLock] = 1;
                            OnPropUpdate(4,keycar);
                            return 1;
                        }
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_GREY,"* You must be Near or in Your car to lock it!");
                        return 1;
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "* You don't have a vehicle at slot 1");
                    return 1;
                }
            }
            else if(strcmp(x_nr,"lock2",true) == 0)
            {
                new keycar = PlayerInfo[playerid][pPcarkey2];
                if(keycar != 9999)
                {
                    new Float:X,Float:Y,Float:Z;
                    GetVehiclePos(keycar,X,Y,Z);
                    if(IsPlayerInRangeOfPoint(playerid, 25,X,Y,Z))
                    {
                        new locked[128];
                        locked = strtok(cmdtext, idx);
                        if(CarInfo[keycar][cLock] == 1)
                        {
                            format(string, sizeof(string), "~w~Vehicle~n~~g~Unlocked");
                            GameTextForPlayer(playerid, string, 4000, 3);
                            SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),playerid,0,0);
                            CarInfo[keycar][cLock] = 0;
                            OnPropUpdate(4,keycar);
                            return 1;
                        }
                        else if(CarInfo[keycar][cLock] == 0)
                        {
                            format(string, sizeof(string), "~w~Vehicle~n~~r~Locked");
                            GameTextForPlayer(playerid, string, 4000, 3);
                            CarInfo[keycar][cLock] = 1;
                            OnPropUpdate(4,keycar);
                            SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),playerid,0,1);
                            return 1;
                        }
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_GREY,"* You must be Near or in Your car to lock it!");
                        return 1;
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "  You don't have a vehicle at slot 2");
                    return 1;
                }
            }

Imagini / Video (optional):
Ati incercat sa rezolvati singur?: am pus la onplayerentervehicle

    new keycar = PlayerInfo[playerid][pPcarkey2];
    if(CarInfo[keycar][cLock] == 1)
    {
             GameTextForPlayer(playerid, "Lock", 4000, 3);
             return 1;
    }

si nu merge

8 answers to this question

Recommended Posts

  • 0
  • Administrator
Posted

Inlocuieste 

SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),playerid,0,0);

si 

SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),playerid,0,1);

cu

SetVehicleParamsForPlayer(keycar,playerid,0,0); 

si

SetVehicleParamsForPlayer(keycar,playerid,0,1);
  • 0
Posted

Am pus asa si merge doar pentru mine alt player poate intra in ea. Ce sa ii fac sa nu poate ceilalti playeri?

  • 0
Posted (edited)

Multumesc merge,

desi atunci cand urci in masina nu scrie gametext Locked

Edited by Selby
  • 0
  • Administrator
Posted

Aici trebuie sa pui si pentru masinile de pe slotul 1 si 3.

 keycar = PlayerInfo[playerid][pPcarkey3];
  if(CarInfo[keycar][cLock] == 1)
  {
       GameTextForPlayer(playerid, "Lock", 4000, 3);
       return 1;
  }

si

 keycar = PlayerInfo[playerid][pPcarkey];
  if(CarInfo[keycar][cLock] == 1)
  {
       GameTextForPlayer(playerid, "Lock", 4000, 3);
       return 1;
  }

Le pui tot unde ai

 new keycar = PlayerInfo[playerid][pPcarkey2];
  if(CarInfo[keycar][cLock] == 1)
  {
       GameTextForPlayer(playerid, "Lock", 4000, 3);
       return 1;
  }
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.