07.03.2012, 20:42
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?
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;
}