Jump to content
  • 0

Problma car system


Linkup

Question

Salut am un system de vehicle la care nu imi merge ceva foarte bine, anume [/car lock]. Sa va explic cum sta treaba. Comanda functioneaza, adica masina se inchide, dar cand intru intr-o casa sau ies de pe server masina este deschisa. Cum pot face asta ca masina sa ramana mereu inchisa.

Cam asa arata code:

else if(strcmp(x_nr,"lock",true) == 0)

        {

    new keycar = PlayerInfo[playerid][pPcarkey];

                if(keycar != 999)

                {

                    new locked[256];

                    locked = strtok(cmdtext, idx);

                    if(CarInfo[keycar][cLock] == 1)

                    {

                    for(new i = 0; i < MAX_PLAYERS; i++)

{

if (IsPlayerConnected(i))

{

SetVehicleParamsForPlayer(keycar,i,0,0);

}

}

format(string, sizeof(string), "~w~Car ~g~Unlocked");

GameTextForPlayer(playerid, string, 4000, 3);

CarInfo[keycar][cLock] = 0;

gCarLock[keycar] = 0;

UnLockCar(keycar);

OnPropUpdate();

return 1;

}

else if(CarInfo[keycar][cLock] == 0)

{

    for(new i = 0; i < MAX_PLAYERS; i++)

{

if (IsPlayerConnected(i))

{

SetVehicleParamsForPlayer(keycar,i,0,1);

}

}

format(string, sizeof(string), "~w~Car ~r~Locked");

GameTextForPlayer(playerid, string, 4000, 3);

CarInfo[keycar][cLock] = 1;

gCarLock[keycar] = 1;

LockCar(keycar);

OnPropUpdate();

return 1;

}

                }

                else

                {

                    SendClientMessage(playerid, COLOR_GREY, "  You don't have a vehicle at slot 1");

                    return 1;

                }

        }

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

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.