Vehice lock.
#1

Hello, I have a /v lock command that makes the player can't turn on the engine if he tried to steal it, But i want to make another lock that locks the door but i don't know how, Any ideas?
Reply
#2

Well, this is mine
pawn Код:
CMD:lock(playerid, params[]) {
    if (!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "ERROR: You must be in a vehicle to use this command!");
    if (GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return SendClientMessage(playerid, COLOR_RED, "ERROR: You must be the driver of a vehicle to use this command");
    new vID = GetPlayerVehicleID(playerid);
    new PlayerName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
    loop(i, MAX_PLAYERS) {
        if (IsPlayerConnected(i) && i != playerid) {
            SetVehicleParamsForPlayer(vID, i, 0, 1);
        }
    }
    SetVehicleParamsForPlayer(vID, playerid, 0, 0);
    SendClientMessage(playerid, COLOR_GREEN, "* Your vehicle is now locked.");
    return 1;
}
Reply
#3

you could make both, or that u can only do the one that the player cant start the engine, when the player is in the car and does /v lock, and when then make another check to detect if the player is near the car, then use (parts of) scots code.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)